read-figma-developer-docs-pages
Retrieve Figma developer documentation pages by specifying paths to access Plugin, Widget, and REST API content for development tasks.
Instructions
Read specific pages of the Figma developer documentation. Provide page paths from the index (e.g., '/docs/plugins/api/TextNode', '/docs/rest-api/authentication'). Returns the full markdown content of each requested page. You can request multiple pages at once.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Array of documentation page paths to read (e.g., ['/docs/plugins/api/TextNode', '/docs/plugins/working-with-text']) |
Implementation Reference
- src/index.ts:91-123 (handler)Implementation of the "read-figma-developer-docs-pages" tool, which retrieves markdown content for specified documentation page paths.
server.registerTool( "read-figma-developer-docs-pages", { title: "Read Figma Developer Docs Pages", description: "Read specific pages of the Figma developer documentation. Provide page paths from the index (e.g., '/docs/plugins/api/TextNode', '/docs/rest-api/authentication'). Returns the full markdown content of each requested page. You can request multiple pages at once.", inputSchema: { paths: z .array(z.string()) .describe( "Array of documentation page paths to read (e.g., ['/docs/plugins/api/TextNode', '/docs/plugins/working-with-text'])" ), }, }, async ({ paths }) => { const results: string[] = []; for (const path of paths) { const content = loadPage(path); if (content) { results.push(`--- Page: ${path} ---\n\n${content}`); } else { results.push( `--- Page: ${path} ---\n\nPage not found. Use read-figma-developer-docs-index to see available pages.` ); } } return { content: [{ type: "text" as const, text: results.join("\n\n") }], }; } ); - src/index.ts:41-49 (helper)Helper function used by the tool to read a specific markdown file from the documentation directory based on a given path.
function loadPage(docPath: string): string | null { let normalizedPath = docPath.startsWith("/") ? docPath : "/" + docPath; normalizedPath = normalizedPath.replace(/\/$/, ""); if (!normalizedPath) normalizedPath = "/index"; const filePath = join(DOCS_DIR, normalizedPath + ".md"); if (!existsSync(filePath)) return null; return readFileSync(filePath, "utf-8"); }