DocsAgents and AI
MCP tools
Agents work through about 190 tools: read the document, change it, generate whole pages, import, export and write code.
1Where an agent should start
get_editor_state returns the open document, page and selection. ToolSearch finds the right tool by keyword, so an agent does not need the whole list up front.
2The layered workflow
design_skeletonlays out the page frame and its sections.design_contentfills one section at a time.design_refinepolishes a finished page.finalize_designruns fixed repair passes over the whole page.
Repairs only touch what the agent generated, never your own layers. New pages are placed to the right of existing work instead of on top of it.
3Tool groups
| Group | Examples |
|---|---|
| Document | open_document, save_document, lint_document, get_design_quality |
| Read | read_nodes, find_node_by_name, snapshot_layout, find_empty_space |
| Edit | insert_node, update_node, move_node, replace_all_matching_properties |
| Selection | set_selection, align_selected, group_selected, boolean_op, undo |
| Pages | add_page, duplicate_page, reorder_page, set_active_page |
| Components | create_component, instantiate_component, add_library, 37 insert_* kit tools |
| Variables | set_variables, set_themes, apply_design_system, save_theme_preset |
| Guidance | get_design_md, get_style_guide, get_guidelines |
| Generate | batch_design, execute, generate, enrich_images, run_design_agent |
| Import | import_svg, import_html, import_html_url, import_pen_dev |
| Export | get_screenshot, export_nodes, export_frames, export_deck |
| Code | codegen_export, codegen_plan, codegen_assemble |
| Preview | set_screen, set_slide_transition, capture_preview, browser |
de tools prints every tool with its parameters, and de <tool> key=value calls one from the terminal.
4Scripts
execute runs JavaScript against the document. A whole script is one undo step, so an agent can make a hundred changes and you can take them back with one Cmd+Z.
5Images and vectors
generate makes AI images, finds stock photos, draws SVG, vectorises an image, removes a background or replaces it. enrich_images fills empty image slots with photos from Openverse, falling back to Wikimedia.
6Form widgets
Agents can place working form controls: text inputs, text areas, number inputs, selects, radio groups, switches, checkboxes, sliders, progress bars and tabs.