Skip to main content
Glama

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
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
weightYesFont 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)}`
              }
            ]
          };
        }
      }
    );
  • 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"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Set' implies a mutation, it doesn't specify whether this operation is reversible, requires specific permissions, or has side effects (e.g., affecting text layout). For a mutation tool with zero annotation coverage, this lack of behavioral detail is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and target, making it easy to parse. Every part of the sentence earns its place by clearly conveying the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., error conditions, success responses), usage context, or output expectations. For a tool that modifies Figma nodes, more context is needed to ensure safe and effective use by an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in the schema (nodeId as 'ID of the text node to modify', weight with numeric values). The description adds no additional parameter semantics beyond what the schema provides, such as explaining valid weight ranges or nodeId sourcing. This meets the baseline for high schema coverage but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set') and target ('font weight of a text node in Figma'), making the purpose immediately understandable. It distinguishes from siblings like 'set_font_size' or 'set_font_name' by specifying the font weight attribute. However, it doesn't explicitly contrast with all similar tools (e.g., 'set_text_content'), which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a text node ID), exclusions (e.g., not applicable to non-text nodes), or relationships with sibling tools like 'set_font_size' or 'set_text_content'. Without any usage context, the agent must infer when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.