create_connections
Connect Figma design nodes with default styling to visualize relationships and workflows between elements in your design files.
Instructions
Create connections between nodes using the default connector style
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connections | Yes | Array of node connections to create |
Implementation Reference
- The handler function for the MCP tool 'create_connections'. It checks if connections are provided, sends the 'create_connections' command with the connections array to the Figma plugin using sendCommandToFigma, and returns success/error messages.async ({ connections }) => { try { if (!connections || connections.length === 0) { return { content: [ { type: "text", text: "No connections provided" } ] }; } const result = await sendCommandToFigma("create_connections", { connections }); return { content: [ { type: "text", text: `Created ${connections.length} connections: ${JSON.stringify(result)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error creating connections: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- Zod input schema for the 'create_connections' tool, defining an array of connection objects each with required startNodeId, endNodeId, and optional text.{ connections: z.array(z.object({ startNodeId: z.string().describe("ID of the starting node"), endNodeId: z.string().describe("ID of the ending node"), text: z.string().optional().describe("Optional text to display on the connector") })).describe("Array of node connections to create") },
- src/talk_to_figma_mcp/server.ts:2413-2458 (registration)Registration of the 'create_connections' MCP tool on the McpServer instance, including name, description, input schema, and handler function.server.tool( "create_connections", "Create connections between nodes using the default connector style", { connections: z.array(z.object({ startNodeId: z.string().describe("ID of the starting node"), endNodeId: z.string().describe("ID of the ending node"), text: z.string().optional().describe("Optional text to display on the connector") })).describe("Array of node connections to create") }, async ({ connections }) => { try { if (!connections || connections.length === 0) { return { content: [ { type: "text", text: "No connections provided" } ] }; } const result = await sendCommandToFigma("create_connections", { connections }); return { content: [ { type: "text", text: `Created ${connections.length} connections: ${JSON.stringify(result)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error creating connections: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- TypeScript type definition for CommandParams.create_connections used in sendCommandToFigma calls, matching the tool's input schema.create_connections: { connections: Array<{ startNodeId: string; endNodeId: string; text?: string; }>; };