Skip to main content
Glama

load_font_async

Load fonts asynchronously in Figma to ensure text elements display correctly without blocking the interface, specifying font family and optional style parameters.

Instructions

Load a font asynchronously in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
familyYesFont family name
styleNoFont style (e.g., 'Regular', 'Bold', 'Italic')

Implementation Reference

  • The execution handler for the 'load_font_async' MCP tool. It sends a 'load_font_async' command to Figma via websocket, processes the result, and returns a formatted text response indicating success or error.
    async ({ family, style }) => {
      try {
        const result = await sendCommandToFigma("load_font_async", {
          family,
          style: style || "Regular"
        });
        const typedResult = result as { success: boolean, family: string, style: string, message: string };
        return {
          content: [
            {
              type: "text",
              text: typedResult.message || `Loaded font ${family} ${style || "Regular"}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error loading font: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Input schema for the 'load_font_async' tool using Zod validation: requires 'family' string, optional 'style' string.
    {
      family: z.string().describe("Font family name"),
      style: z.string().optional().describe("Font style (e.g., 'Regular', 'Bold', 'Italic')"),
    },
  • Registration of the 'load_font_async' tool on the MCP server within the registerTextTools function, including name, description, input schema, and handler.
    server.tool(
      "load_font_async",
      "Load a font asynchronously in Figma",
      {
        family: z.string().describe("Font family name"),
        style: z.string().optional().describe("Font style (e.g., 'Regular', 'Bold', 'Italic')"),
      },
      async ({ family, style }) => {
        try {
          const result = await sendCommandToFigma("load_font_async", {
            family,
            style: style || "Regular"
          });
          const typedResult = result as { success: boolean, family: string, style: string, message: string };
          return {
            content: [
              {
                type: "text",
                text: typedResult.message || `Loaded font ${family} ${style || "Regular"}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error loading font: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool loads a font asynchronously, implying a non-blocking operation, but doesn't clarify what 'asynchronously' means in practice (e.g., whether it returns immediately, requires polling, or handles errors). It also omits details like permissions needed, rate limits, or what happens if the font isn't available.

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 with zero waste. It's front-loaded with the core action and context, making it easy to parse quickly without unnecessary elaboration.

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 tool's complexity (asynchronous operation with 2 parameters) and lack of annotations or output schema, the description is incomplete. It doesn't explain what 'asynchronously' entails, potential side effects, error handling, or return values, leaving significant gaps for the agent to operate effectively.

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%, so the schema already documents both parameters ('family' and 'style') adequately. The description adds no additional meaning beyond what's in the schema, such as examples of valid font families or style conventions. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Load a font asynchronously') and resource ('in Figma'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'set_font_name' or 'set_font_weight', which might handle font-related operations differently.

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 document open), exclusions, or compare it to sibling tools like 'set_font_name', leaving the agent to infer usage context.

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

Install Server

Other Tools

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/agenisea/cc-fig-mcp'

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