Skip to content

Text & Fonts

Tools for modifying text content, properties, and fonts

3 tools in this domain.

edit

Set text content on text nodes. Batch: pass multiple items to replace text in multiple nodes at once.

ParameterTypeRequiredDescription
itemsobject[]Array of {nodeId, text}
nodeIdstringText node ID
textstringNew text content
depthnumberResponse detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.
JSON Schema
{
  "type": "object",
  "properties": {
    "items": {
      "description": "Array of {nodeId, text}",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string",
            "description": "Text node ID"
          },
          "text": {
            "type": "string",
            "description": "New text content"
          }
        },
        "required": [
          "nodeId",
          "text"
        ]
      }
    },
    "depth": {
      "description": "Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
      "type": "number"
    }
  },
  "required": [
    "items"
  ]
}

Response reference only — not included in tool definitions

FieldTypeDescription
results("ok" | error)[]Per-item results.
errorstringError message for this item
warningsstring[]Deduplicated warnings hoisted from individual results
Example response
{
  "results": [
    "ok",
    "ok"
  ]
}
Response JSON Schema
{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "description": "Per-item results.",
      "items": {
        "oneOf": [
          {
            "type": "string",
            "const": "ok"
          },
          {
            "title": "error",
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Error message for this item"
              }
            },
            "required": [
              "error"
            ]
          }
        ]
      }
    },
    "warnings": {
      "type": "array",
      "description": "Deduplicated warnings hoisted from individual results",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "results"
  ]
}

Scan all text nodes within a node tree. Batch: pass multiple items.

ParameterTypeRequiredDescription
itemsobject[]Array of {nodeId}
nodeIdstringNode ID
limitnumberMax text nodes to return (default: 50)
includePathbooleanInclude ancestor path strings (default: true). Set false to reduce payload.
includeGeometrybooleanInclude absoluteX/absoluteY/width/height (default: true). Set false to reduce payload.
JSON Schema
{
  "type": "object",
  "properties": {
    "items": {
      "description": "Array of {nodeId}",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string",
            "description": "Node ID"
          },
          "limit": {
            "description": "Max text nodes to return (default: 50)",
            "type": "number"
          },
          "includePath": {
            "description": "Include ancestor path strings (default: true). Set false to reduce payload.",
            "type": "boolean"
          },
          "includeGeometry": {
            "description": "Include absoluteX/absoluteY/width/height (default: true). Set false to reduce payload.",
            "type": "boolean"
          }
        },
        "required": [
          "nodeId"
        ]
      }
    }
  },
  "required": [
    "items"
  ]
}

Response reference only — not included in tool definitions

FieldTypeDescription
results(success | error)[]Per-item results.
nodeIdstring
countnumberTotal text nodes found
truncatedbooleanWhether results were truncated
textNodesobject[]
idstring
namestring
charactersstringText content
fontSizenumber
fontFamilystring
fontStylestring
absoluteXnumber
absoluteYnumber
widthnumber
heightnumber
pathstringAncestor path string
pathIdsstring
depthnumber
errorstringError message for this item
warningsstring[]Deduplicated warnings hoisted from individual results
Example response
{
  "results": [
    {
      "nodeId": "1:2",
      "count": 2,
      "truncated": false,
      "textNodes": [
        {
          "id": "1:5",
          "name": "Label",
          "characters": "Submit",
          "fontSize": 14,
          "fontFamily": "Inter",
          "fontStyle": "Medium",
          "path": "Card > Button > Label",
          "depth": 2
        }
      ]
    }
  ]
}
Response JSON Schema
{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "description": "Per-item results.",
      "items": {
        "oneOf": [
          {
            "title": "success",
            "type": "object",
            "properties": {
              "nodeId": {
                "type": "string"
              },
              "count": {
                "type": "number",
                "description": "Total text nodes found"
              },
              "truncated": {
                "type": "boolean",
                "description": "Whether results were truncated"
              },
              "textNodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "characters": {
                      "type": "string",
                      "description": "Text content"
                    },
                    "fontSize": {
                      "type": "number"
                    },
                    "fontFamily": {
                      "type": "string"
                    },
                    "fontStyle": {
                      "type": "string"
                    },
                    "absoluteX": {
                      "type": "number"
                    },
                    "absoluteY": {
                      "type": "number"
                    },
                    "width": {
                      "type": "number"
                    },
                    "height": {
                      "type": "number"
                    },
                    "path": {
                      "type": "string",
                      "description": "Ancestor path string"
                    },
                    "pathIds": {
                      "type": "string"
                    },
                    "depth": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          {
            "title": "error",
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Error message for this item"
              }
            },
            "required": [
              "error"
            ]
          }
        ]
      }
    },
    "warnings": {
      "type": "array",
      "description": "Deduplicated warnings hoisted from individual results",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "results"
  ]
}

Get available fonts in Figma. Optionally filter by query string.

ParameterTypeRequiredDescription
querystringFilter fonts by name (case-insensitive). Omit to list all fonts.
JSON Schema
{
  "type": "object",
  "properties": {
    "query": {
      "description": "Filter fonts by name (case-insensitive). Omit to list all fonts.",
      "type": "string"
    }
  }
}

Response reference only — not included in tool definitions

FieldTypeDescription
countnumber
fontsobject[]
familystring
stylesstring[]
Example response
{
  "count": 2,
  "fonts": [
    {
      "family": "Inter",
      "styles": [
        "Regular",
        "Medium",
        "Bold"
      ]
    },
    {
      "family": "Roboto",
      "styles": [
        "Regular",
        "Bold"
      ]
    }
  ]
}
Response JSON Schema
{
  "type": "object",
  "properties": {
    "count": {
      "type": "number"
    },
    "fonts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "family": {
            "type": "string"
          },
          "styles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "required": [
    "count",
    "fonts"
  ]
}