Skip to main content
Glama

get_component

Retrieve Figma components by key to access design elements from files, enabling integration and reuse in projects.

Instructions

Get a component by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesThe component key

Implementation Reference

  • The core handler function for the 'get_component' tool. It extracts the component key from args and makes a GET request to Figma API endpoint `/components/${key}`.
    async getComponent(args: GetComponentArgs) {
      const { key } = args;
      
      return this.api.makeRequest(`/components/${key}`);
    }
  • TypeScript interface defining the input schema for the get_component tool, requiring a 'key' string.
    export interface GetComponentArgs {
      key: string;
    }
  • src/index.ts:376-388 (registration)
    Tool registration in the listTools response, including name, description, and input schema matching GetComponentArgs.
      name: 'get_component',
      description: 'Get a component by key',
      inputSchema: {
        type: 'object',
        properties: {
          key: {
            type: 'string',
            description: 'The component key'
          }
        },
        required: ['key']
      },
    },
  • src/index.ts:578-584 (registration)
    Dispatch logic in the CallToolRequest handler switch statement that validates args and calls the projectsHandler.getComponent method.
    case 'get_component': {
      const args = this.validateArgs<GetComponentArgs>(request.params.arguments, ['key']);
      const result = await this.projectsHandler.getComponent(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Get' implies a read operation, but it doesn't specify authentication requirements, rate limits, error conditions, or what happens if the key doesn't exist. The description provides minimal behavioral context beyond the basic operation.

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 extremely concise with just four words, front-loading the essential information without any wasted words. It efficiently communicates the core function in minimal space.

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?

For a tool with no annotations, no output schema, and multiple similar sibling tools, the description is inadequate. It doesn't explain what a 'component' is, how it differs from other resource types, what format the response takes, or when to choose this over similar tools. The minimal description leaves significant contextual gaps.

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 the single parameter 'key' fully documented in the schema. The description adds no additional parameter information beyond what the schema provides, which is acceptable given the 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.

Purpose3/5

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

The description 'Get a component by key' states the basic action (get) and resource (component), but is vague about what a 'component' represents in this context and doesn't distinguish it from similar sibling tools like 'get_file_components' or 'get_team_components'. It provides minimal but functional purpose information.

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?

No guidance is provided about when to use this tool versus alternatives like 'get_file_components' or 'get_team_components'. The description doesn't mention prerequisites, context, or exclusions, leaving the agent with no usage differentiation from sibling tools.

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/smithery-ai/mcp-figma'

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