Skip to main content
Glama

set_font_size

Adjust text size in Figma designs by specifying pixel values for text nodes, enabling precise typography control through the Claude Talk to Figma MCP server.

Instructions

Set the font size of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
fontSizeYesFont size in pixels

Implementation Reference

  • The complete MCP tool registration for 'set_font_size', including description, Zod input schema, and async handler function that sends the command to Figma and returns success/error messages.
    server.tool( "set_font_size", "Set the font size of a text node in Figma", { nodeId: z.string().describe("The ID of the text node to modify"), fontSize: z.number().positive().describe("Font size in pixels"), }, async ({ nodeId, fontSize }) => { try { const result = await sendCommandToFigma("set_font_size", { nodeId, fontSize }); const typedResult = result as { name: string, fontSize: number }; return { content: [ { type: "text", text: `Updated font size of node "${typedResult.name}" to ${typedResult.fontSize}px` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error setting font size: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • TypeScript type definition for FigmaCommand union including 'set_font_size' used in sendCommandToFigma calls.
    | "set_font_size"
  • Call to registerTextTools which includes the set_font_size tool registration.
    registerTextTools(server);
  • Top-level call to registerTools which chains to text tools registration including set_font_size.
    registerTools(server);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arinspunk/claude-talk-to-figma-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server