get_team_component_sets
Retrieve component sets for a specified Figma team to access and manage design system elements. Supports pagination for handling large collections.
Instructions
Get component sets for a team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_id | Yes | The team ID | |
| page_size | No | Optional. Number of items per page | |
| cursor | No | Optional. Cursor for pagination |
Implementation Reference
- src/handlers/projects.ts:50-55 (handler)The core handler function for the 'get_team_component_sets' tool. It extracts the team_id and pagination parameters from args, constructs the query string, and makes an API request to Figma's /teams/{team_id}/component_sets endpoint.async getTeamComponentSets(args: GetTeamComponentSetsArgs) { const { team_id, ...paginationParams } = args; const params = { ...paginationParams }; return this.api.makeRequest(`/teams/${team_id}/component_sets${this.api.buildQueryString(params)}`); }
- src/index.ts:389-410 (registration)Registers the tool in the MCP server's listTools response, defining its name, description, and JSON input schema matching GetTeamComponentSetsArgs.{ name: 'get_team_component_sets', description: 'Get component sets for a team', inputSchema: { type: 'object', properties: { team_id: { type: 'string', description: 'The team ID' }, page_size: { type: 'number', description: 'Optional. Number of items per page' }, cursor: { type: 'string', description: 'Optional. Cursor for pagination' } }, required: ['team_id'] }, },
- src/types/projects.ts:24-26 (schema)TypeScript interface for input args: requires team_id, extends PaginationParams (page_size, cursor). Used for type safety in handler and validation.export interface GetTeamComponentSetsArgs extends PaginationParams { team_id: string; }
- src/index.ts:586-592 (registration)Dispatch handler in CallToolRequestSchema switch statement: validates args, calls projectsHandler.getTeamComponentSets, and returns JSON stringified result.case 'get_team_component_sets': { const args = this.validateArgs<GetTeamComponentSetsArgs>(request.params.arguments, ['team_id']); const result = await this.projectsHandler.getTeamComponentSets(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }