search_icons
Find icons on The Noun Project by searching with terms and filtering by style, line weight, public domain status, thumbnail size, and SVG inclusion.
Instructions
Search for icons on The Noun Project. Supports filtering by style (solid/line), line weight, public domain status, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search term for icons (e.g., "dog", "house", "bicycle") | |
| styles | No | Filter by icon style: solid, line, or both (solid,line) | |
| line_weight | No | For line icons, filter by line weight (1-60) or range (e.g., "18-20") | |
| limit_to_public_domain | No | Set to 1 to limit results to public domain icons only | |
| thumbnail_size | No | Thumbnail size to return (42, 84, or 200 pixels) | |
| include_svg | No | Set to 1 to include SVG URLs in the response | |
| limit | No | Maximum number of results to return |
Implementation Reference
- src/api.ts:65-85 (handler)Core implementation of the search_icons tool: constructs query parameters from input, builds OAuth-signed API request to Noun Project /v2/icon endpoint, and returns the search results.async searchIcons(params: SearchIconsParams) { const { query, ...rest } = params; const queryParams = new URLSearchParams({ query, ...Object.fromEntries( Object.entries(rest) .filter(([_, v]) => v !== undefined) .map(([k, v]) => [k, String(v)]) ), }); const url = `${BASE_URL}/v2/icon?${queryParams}`; const headers = this.oauth.getHeaders(url); const response = await this.client.get('/v2/icon', { params: Object.fromEntries(queryParams), headers, }); return response.data; }
- src/api.ts:6-16 (schema)TypeScript type definition for input parameters accepted by the searchIcons handler.export interface SearchIconsParams { query: string; styles?: 'solid' | 'line' | 'solid,line'; line_weight?: number | string; limit_to_public_domain?: 0 | 1; thumbnail_size?: 42 | 84 | 200; include_svg?: 0 | 1; limit?: number; next_page?: string; prev_page?: string; }
- src/tools.ts:4-48 (registration)MCP tool registration: defines name, description, and input schema for the 'search_icons' tool in the exported TOOLS array.{ name: 'search_icons', description: 'Search for icons on The Noun Project. Supports filtering by style (solid/line), line weight, public domain status, and more.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term for icons (e.g., "dog", "house", "bicycle")', }, styles: { type: 'string', enum: ['solid', 'line', 'solid,line'], description: 'Filter by icon style: solid, line, or both (solid,line)', }, line_weight: { type: ['number', 'string'], description: 'For line icons, filter by line weight (1-60) or range (e.g., "18-20")', }, limit_to_public_domain: { type: 'number', enum: [0, 1], description: 'Set to 1 to limit results to public domain icons only', }, thumbnail_size: { type: 'number', enum: [42, 84, 200], description: 'Thumbnail size to return (42, 84, or 200 pixels)', }, include_svg: { type: 'number', enum: [0, 1], description: 'Set to 1 to include SVG URLs in the response', }, limit: { type: 'number', description: 'Maximum number of results to return', }, }, required: ['query'], }, },
- src/index.ts:54-64 (handler)MCP server dispatch handler for 'search_icons' tool calls: invokes the api.searchIcons function and formats output as MCP response content.case 'search_icons': { const result = await api.searchIcons(args as any); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:42-46 (registration)Registers the tool list handler, which returns the TOOLS array including 'search_icons' for MCP clients to discover available tools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS, }; });