get_icon
Retrieve detailed metadata, creator information, tags, and download URLs for specific icons using their unique ID numbers.
Instructions
Get detailed information about a specific icon by its ID. Returns icon metadata, creator info, tags, and download URLs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| icon_id | Yes | The unique ID of the icon | |
| thumbnail_size | No | Thumbnail size to return (42, 84, or 200 pixels) |
Implementation Reference
- src/api.ts:90-104 (handler)Core implementation of the get_icon tool: fetches detailed icon information by ID from Noun Project API using OAuth-authenticated GET request.async getIcon(params: GetIconParams) { const { icon_id, thumbnail_size } = params; const queryParams = thumbnail_size ? `?thumbnail_size=${thumbnail_size}` : ''; const url = `${BASE_URL}/v2/icon/${icon_id}${queryParams}`; const headers = this.oauth.getHeaders(url); const response = await this.client.get(`/v2/icon/${icon_id}`, { params: thumbnail_size ? { thumbnail_size } : undefined, headers, }); return response.data; }
- src/index.ts:66-76 (handler)MCP callTool dispatch handler for 'get_icon': calls the API method and returns JSON-formatted result as text content.case 'get_icon': { const result = await api.getIcon(args as any); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/tools.ts:49-68 (schema)MCP tool definition for 'get_icon' including name, description, and input schema for validation.{ name: 'get_icon', description: 'Get detailed information about a specific icon by its ID. Returns icon metadata, creator info, tags, and download URLs.', inputSchema: { type: 'object', properties: { icon_id: { type: 'number', description: 'The unique ID of the icon', }, thumbnail_size: { type: 'number', enum: [42, 84, 200], description: 'Thumbnail size to return (42, 84, or 200 pixels)', }, }, required: ['icon_id'], }, },
- src/api.ts:18-21 (schema)TypeScript interface defining input parameters for the getIcon method.export interface GetIconParams { icon_id: number; thumbnail_size?: 42 | 84 | 200; }
- src/index.ts:42-46 (registration)Registers the listTools handler that provides the tool list including 'get_icon'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS, }; });