跳转到内容

Document & Navigation

用于检查和浏览文档与页面的工具

此分类共 5 个工具。

Get the document name, current page, and list of all pages.

无参数

JSON Schema
{}

返回值 仅供参考 — 不包含在工具定义中

FieldTypeDescription
namestringDocument name
currentPageIdstringActive page ID
pagesobject[]
idstring
namestring
示例返回
{
  "name": "Design System",
  "currentPageId": "0:1",
  "pages": [
    {
      "id": "0:1",
      "name": "Components"
    },
    {
      "id": "5:0",
      "name": "Icons"
    }
  ]
}
返回值 JSON Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Document name"
    },
    "currentPageId": {
      "type": "string",
      "description": "Active page ID"
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "name",
    "currentPageId",
    "pages"
  ]
}

Get the current page info and its top-level children.

无参数

JSON Schema
{}

返回值 仅供参考 — 不包含在工具定义中

FieldTypeDescription
idstring
namestring
childrenobject[]Top-level children on the page
idstringNode ID
namestring
typestring
示例返回
{
  "id": "0:1",
  "name": "Components",
  "children": [
    {
      "id": "1:2",
      "name": "Button",
      "type": "COMPONENT_SET"
    }
  ]
}
返回值 JSON Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "children": {
      "type": "array",
      "description": "Top-level children on the page",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Node ID"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "id",
    "name",
    "children"
  ]
}

Switch to a different page. Provide either pageId or pageName.

ParameterTypeRequiredDescription
pageIdstringThe page ID to switch to
pageNamestringThe page name (case-insensitive, partial match)
JSON Schema
{
  "type": "object",
  "properties": {
    "pageId": {
      "description": "The page ID to switch to",
      "type": "string"
    },
    "pageName": {
      "description": "The page name (case-insensitive, partial match)",
      "type": "string"
    }
  }
}

返回值 仅供参考 — 不包含在工具定义中

FieldTypeDescription
idstring
namestring
示例返回
{
  "id": "5:0",
  "name": "Icons"
}
返回值 JSON Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "name"
  ]
}
create

Create a new page in the document

ParameterTypeRequiredDescription
namestringName for the new page (default: 'New Page')
JSON Schema
{
  "type": "object",
  "properties": {
    "name": {
      "description": "Name for the new page (default: 'New Page')",
      "type": "string"
    }
  }
}

返回值 仅供参考 — 不包含在工具定义中

FieldTypeDescription
idstringNew page ID
示例返回
{
  "id": "12:0"
}
返回值 JSON Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "New page ID"
    }
  },
  "required": [
    "id"
  ]
}
edit

Rename a page. Defaults to current page if no pageId given.

ParameterTypeRequiredDescription
newNamestringNew name for the page
pageIdstringPage ID (default: current page)
JSON Schema
{
  "type": "object",
  "properties": {
    "newName": {
      "type": "string",
      "description": "New name for the page"
    },
    "pageId": {
      "description": "Page ID (default: current page)",
      "type": "string"
    }
  },
  "required": [
    "newName"
  ]
}

返回值 仅供参考 — 不包含在工具定义中

无参数

示例返回
"ok"
返回值 JSON Schema
{
  "type": "string",
  "const": "ok"
}