Skip to main content
Glama

search_collections

Find icon collections on The Noun Project by entering search terms, with options to filter results and control pagination for efficient browsing.

Instructions

Search for collections on The Noun Project. Returns a list of collections matching the search term.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term for collections (e.g., "winter", "business", "animals")
blacklistNoSet to 1 to remove results matching terms or IDs in blacklist
limitNoMaximum number of results to return
prev_pageNoToken for paging to the previous page
next_pageNoToken for paging to the next page

Implementation Reference

  • The core handler function implementing the search_collections tool logic. It constructs query parameters from input, authenticates with OAuth, and fetches collection search results from the Noun Project API /v2/collection endpoint.
    async searchCollections(params: SearchCollectionsParams) { 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/collection?${queryParams}`; const headers = this.oauth.getHeaders(url); const response = await this.client.get('/v2/collection', { params: Object.fromEntries(queryParams), headers, }); return response.data; }
  • MCP tool input schema defining parameters for search_collections, including query (required), optional filters like limit, blacklist, and pagination tokens.
    inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term for collections (e.g., "winter", "business", "animals")', }, blacklist: { type: 'number', enum: [0, 1], description: 'Set to 1 to remove results matching terms or IDs in blacklist', }, limit: { type: 'number', description: 'Maximum number of results to return', }, prev_page: { type: 'string', description: 'Token for paging to the previous page', }, next_page: { type: 'string', description: 'Token for paging to the next page', }, }, required: ['query'], },
  • src/tools.ts:98-129 (registration)
    Registration of the search_collections tool in the TOOLS array, which is returned by the ListTools handler.
    { name: 'search_collections', description: 'Search for collections on The Noun Project. Returns a list of collections matching the search term.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term for collections (e.g., "winter", "business", "animals")', }, blacklist: { type: 'number', enum: [0, 1], description: 'Set to 1 to remove results matching terms or IDs in blacklist', }, limit: { type: 'number', description: 'Maximum number of results to return', }, prev_page: { type: 'string', description: 'Token for paging to the previous page', }, next_page: { type: 'string', description: 'Token for paging to the next page', }, }, required: ['query'], }, },
  • MCP server tool call dispatcher case for search_collections, invoking the API handler and formatting the JSON response.
    case 'search_collections': { const result = await api.searchCollections(args as any); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • TypeScript interface defining input parameters for the searchCollections method, matching the tool schema.
    export interface SearchCollectionsParams { query: string; blacklist?: 0 | 1; limit?: number; prev_page?: string; next_page?: string; }

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/sgup/noun-project-mcp'

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