get_style
Retrieve Figma design styles by key to access colors, typography, and effects for consistent UI implementation.
Instructions
Get a style by key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The style key |
Implementation Reference
- src/handlers/projects.ts:70-74 (handler)The core handler function for the 'get_style' tool. It extracts the style key from arguments and makes an API request to Figma's /styles/{key} endpoint to retrieve the style details.async getStyle(args: GetStyleArgs) { const { key } = args; return this.api.makeRequest(`/styles/${key}`); }
- src/types/projects.ts:36-38 (schema)TypeScript interface defining the input arguments for the get_style tool, requiring a single 'key' property of type string.export interface GetStyleArgs { key: string; }
- src/index.ts:447-460 (registration)MCP tool registration in the listTools response, defining the name, description, and input schema for 'get_style'.{ name: 'get_style', description: 'Get a style by key', inputSchema: { type: 'object', properties: { key: { type: 'string', description: 'The style key' } }, required: ['key'] }, }
- src/index.ts:610-616 (registration)Dispatch handler in the CallToolRequest that validates arguments using GetStyleArgs type and delegates to projectsHandler.getStyle.case 'get_style': { const args = this.validateArgs<GetStyleArgs>(request.params.arguments, ['key']); const result = await this.projectsHandler.getStyle(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }