Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.
updateXmlForNodeTOOL
Update the XML for a node using its nodeId and passing a new XML string. It can be used to update nodes text or attributes, reorder nodes in the XML tree, or create new nodes.
IMPORTANT: Call getProjectXml first to see available node attributes, pre-built section components, and project structure.

Node Creation

Nodes without a nodeId attribute will be created as new nodes. To create a new node, simply omit the nodeId attribute. The node type is determined by the content and attributes:
  • Nodes with layout attributes (layout="stack" or layout="grid") become Frame nodes
  • Nodes with svg attribute become SVG nodes
  • Nodes with componentId or insertUrl attributes become ComponentInstance nodes. This is the PREFERRED way to insert components with full attribute support in one step. Get the insertUrl using getComponentInsertUrlAndTypes first.
    • Linked components (default): Use insertUrl as-is to create a linked component instance that updates when the source component changes
    • Detached components: Add ?detached=true query parameter to insertUrl (e.g., insertUrl="https://framer.com/m/Button.js?detached=true") to create detached/unlinked layers. The component's internal structure becomes editable regular nodes (Frame, Text, etc.) that won't update with the source. IMPORTANT: After creating a detached component, you MUST call getNodeXml on the parent node again to see the actual internal structure that was created, as it will contain multiple child nodes (Text, Frame, SVG, etc.) from the component's definition.
  • Nodes with text content become Text nodes. To add a text node you must create a new wrapping element too and omit its nodeId, you CANNOT add text to an existing element that does not already contain text
The tag name of new nodes will be used for the new node title in Framer, it has no semantic meaning
When creating a new node ALWAYS mention the node before and after it so that it can be put in the right place. Also ALWAYS wrap it with a known nodeId wrapper node (usually the same nodeId used in the tool params).
The tool output will contain the newly created node ids, in following calls you MUST use those nodeIds to reference the newly created nodes.
IMPORTANT! You cannot add text content to an existing element with an existing nodeId it if does not already contain text! Instead put the new text inside a wrapper Text element

Node Updates

If a node id changes its parent, it will be moved in the tree.
Do not pass a string too large in this tool, instead call this tool multiple times and pass only the nodes you want to update, omit attributes or nodes that you don't need to update.
Call this tool multiple times instead of batching all the updates in one tool call. This way the user will be able to see your changes in real-time in the Framer canvas.
This tool is generally called using a component or page nodeId and passing a portion of the XML tree. To delete nodes you should use deleteNode instead. If a node is omitted it will not be deleted.
You can pass a partial a XML string, there is no need to include the full XML structure, missing nodes will be ignored. You can also omit attributes, omitted attributes will be ignored.

Capabilities

You can use this tool to:
  • Create new nodes by omitting nodeId attribute (Frame, Text, SVG, ComponentInstance)
  • Insert components as linked instances or detached layers (use insertUrl with optional ?detached=true)
  • Update text content for one or multiple nodes
  • Update attributes of existing nodes
  • Reorder nodes in the tree by changing their parent or position
  • Create wrapper layers by placing existing nodes inside new nodes
For adding sections (hero, pricing, footer, etc.), see the Pre-built Section Components documentation in getProjectXml output.
This tool CANNOT be used for:
  • Code files (use 'updateCodeFile' instead)
  • Color styles (use 'manageColorStyle' with type: 'update' instead)
  • Text styles (use 'manageTextStyle' with type: 'update' instead)
  • Deleting nodes (use 'deleteNode' instead)

Return Value

Returns a summary of changes made, followed by a diff patch showing the XML changes in unified diff format.
idempotent
Parameters
nodeId *string
The ID of the node to update
Min length: 1
xml *string
XML string containing the updates. Can include multiple nodes with their nodeId attributes
Min length: 1
zoomIntoView?boolean
Whether to zoom into the node before making updates in Framer. Set to true to see where updates will happen (default), false to run updates in background. Do not ask user about this setting - default to true and mention they can disable zooming if they want to use Framer app while MCP is working.
Request example
{ "method": "tools/call", "params": { "name": "updateXmlForNode", "arguments": { "nodeId": "string", "xml": "string", "zoomIntoView": true } } }