set_font_weight
Adjust text boldness in Figma by specifying font weight values from 100 to 900 for precise typography control.
Instructions
Set the font weight of a text node in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the text node to modify | |
| weight | Yes | Font weight (100, 200, 300, 400, 500, 600, 700, 800, 900) |
Implementation Reference
- Full MCP tool registration block for 'set_font_weight', including Zod input schema, description, and async handler function that sends the command to Figma via sendCommandToFigma and returns success/error text response.server.tool( "set_font_weight", "Set the font weight of a text node in Figma", { nodeId: z.string().describe("The ID of the text node to modify"), weight: z.number().describe("Font weight (100, 200, 300, 400, 500, 600, 700, 800, 900)"), }, async ({ nodeId, weight }) => { try { const result = await sendCommandToFigma("set_font_weight", { nodeId, weight }); const typedResult = result as { name: string, fontName: { family: string, style: string }, weight: number }; return { content: [ { type: "text", text: `Updated font weight of node "${typedResult.name}" to ${typedResult.weight} (${typedResult.fontName.style})` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error setting font weight: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- src/talk_to_figma_mcp/tools/index.ts:16-16 (registration)Invocation of registerTextTools(server), which registers the set_font_weight tool among other text tools.registerTextTools(server);
- 'set_font_weight' included in FigmaCommand type union for type-safe command strings.| "set_font_weight"