get_nodes_info
Retrieve detailed information about multiple nodes in Figma using this tool, enabling precise analysis and interaction with design elements through AI-assisted commands.
Instructions
Get detailed information about multiple nodes in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'get_nodes_info' tool. It takes an array of nodeIds, fetches information for each using 'get_node_info' command in parallel with Promise.all, filters the results using filterFigmaNode, and returns them as JSON text content.async ({ nodeIds }) => { try { const results = await Promise.all( nodeIds.map(async (nodeId) => { const result = await sendCommandToFigma('get_node_info', { nodeId }); return { nodeId, info: result }; }) ); return { content: [ { type: "text", text: JSON.stringify(results.map((result) => filterFigmaNode(result.info))) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting nodes info: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- Zod input schema for the 'get_nodes_info' tool, defining the required 'nodeIds' parameter as an array of strings.{ nodeIds: z.array(z.string()).describe("Array of node IDs to get information about") },
- src/talk_to_figma_mcp/tools/document-tools.ts:101-134 (registration)Registration of the 'get_nodes_info' tool on the MCP server using server.tool(), including name, description, schema, and handler.server.tool( "get_nodes_info", "Get detailed information about multiple nodes in Figma", { nodeIds: z.array(z.string()).describe("Array of node IDs to get information about") }, async ({ nodeIds }) => { try { const results = await Promise.all( nodeIds.map(async (nodeId) => { const result = await sendCommandToFigma('get_node_info', { nodeId }); return { nodeId, info: result }; }) ); return { content: [ { type: "text", text: JSON.stringify(results.map((result) => filterFigmaNode(result.info))) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting nodes info: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- src/talk_to_figma_mcp/tools/index.ts:14-14 (registration)Call to registerDocumentTools which includes the 'get_nodes_info' tool, within the overall registerTools function.registerDocumentTools(server);
- src/talk_to_figma_mcp/server.ts:34-34 (registration)Invocation of registerTools in the main server setup, which chains to the registration of 'get_nodes_info'.registerTools(server);