Skip to main content
Glama
akari2600

figma-developer-docs-mcp

by akari2600

Search Figma Developer Docs

search-figma-developer-docs

Search Figma developer documentation to find specific information across Plugin, Widget, and REST API sections. Get relevant page paths and content excerpts for development queries.

Instructions

Search across all Figma developer documentation for a keyword or phrase. Returns matching page paths and relevant excerpts. Useful when you know what you're looking for but not which page it's on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query — keyword or phrase to find in the documentation
sectionNoOptional: limit search to a specific section (e.g., 'plugins', 'rest-api', 'widgets')
maxResultsNoMaximum number of results to return (default: 10)

Implementation Reference

  • The handler function for 'search-figma-developer-docs' that performs a keyword search across indexed Figma developer documentation.
    async ({ query, section, maxResults }) => {
      const index = loadIndex();
      const queryLower = query.toLowerCase();
      const results: Array<{
        path: string;
        title: string;
        excerpt: string;
        score: number;
      }> = [];
    
      const sectionsToSearch = section
        ? { [section]: index.sections[section] }
        : index.sections;
    
      for (const [, sectionData] of Object.entries(sectionsToSearch)) {
        if (!sectionData) continue;
    
        for (const page of sectionData.pages) {
          const content = loadPage(page.path);
          if (!content) continue;
    
          const contentLower = content.toLowerCase();
          const titleLower = page.title.toLowerCase();
    
          let score = 0;
          if (titleLower.includes(queryLower)) score += 10;
    
          let idx = 0;
          let contentMatches = 0;
          while (
            (idx = contentLower.indexOf(queryLower, idx)) !== -1 &&
            contentMatches < 50
          ) {
            contentMatches++;
            idx += queryLower.length;
          }
          score += contentMatches;
    
          if (score === 0) continue;
    
          let excerpt = "";
          const firstMatch = contentLower.indexOf(queryLower);
          if (firstMatch !== -1) {
            const start = Math.max(0, firstMatch - 100);
            const end = Math.min(content.length, firstMatch + query.length + 200);
            excerpt = content.slice(start, end).replace(/\n/g, " ").trim();
            if (start > 0) excerpt = "..." + excerpt;
            if (end < content.length) excerpt = excerpt + "...";
          }
    
          results.push({ path: page.path, title: page.title, excerpt, score });
        }
      }
    
      results.sort((a, b) => b.score - a.score);
      const topResults = results.slice(0, maxResults || 10);
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(
              { query, section: section || "all", totalMatches: results.length, results: topResults },
              null,
              2
            ),
          },
        ],
      };
  • src/index.ts:125-147 (registration)
    The registration of the 'search-figma-developer-docs' tool, including its schema and metadata.
    server.registerTool(
      "search-figma-developer-docs",
      {
        title: "Search Figma Developer Docs",
        description:
          "Search across all Figma developer documentation for a keyword or phrase. Returns matching page paths and relevant excerpts. Useful when you know what you're looking for but not which page it's on.",
        inputSchema: {
          query: z
            .string()
            .describe("Search query — keyword or phrase to find in the documentation"),
          section: z
            .string()
            .optional()
            .describe(
              "Optional: limit search to a specific section (e.g., 'plugins', 'rest-api', 'widgets')"
            ),
          maxResults: z
            .number()
            .optional()
            .default(10)
            .describe("Maximum number of results to return (default: 10)"),
        },
      },
Behavior3/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 describes what the tool does (search documentation) and what it returns (matching page paths and relevant excerpts), but lacks details on permissions, rate limits, error handling, or pagination behavior. It's adequate but has clear gaps for a search tool.

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 perfectly concise with two sentences that each earn their place: the first explains the core functionality, and the second provides usage context. It's front-loaded with the main purpose and wastes no words.

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

Completeness3/5

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

Given the tool's moderate complexity (search function with 3 parameters), no annotations, and no output schema, the description is minimally complete. It covers the basic purpose and usage context but lacks details on return format, error cases, or behavioral constraints that would be helpful for an AI 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%, so the schema already fully documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter explanation.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('Search across all Figma developer documentation') and resources ('documentation'), and distinguishes it from siblings by explaining it's for when you 'know what you're looking for but not which page it's on' (unlike the read-index and read-pages tools).

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool ('when you know what you're looking for but not which page it's on'), which implicitly differentiates it from the sibling tools that likely retrieve specific pages or indices. However, it doesn't explicitly state when NOT to use it or name alternatives beyond the implied distinction.

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/akari2600/figma-developer-docs-mcp'

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