Skip to main content
Glama

get_collection

Retrieve collection metadata and contained icons by ID, with options for thumbnail size, SVG inclusion, and result limits.

Instructions

Get a collection by ID. Returns collection metadata and the icons it contains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesThe unique ID of the collection
thumbnail_sizeNoThumbnail size to return for icons (42, 84, or 200 pixels)
include_svgNoSet to 1 to include SVG URLs in the response
limitNoMaximum number of icons to return from the collection

Implementation Reference

  • src/tools.ts:69-97 (registration)
    Registers the 'get_collection' tool in the TOOLS array for MCP, including name, description, and input schema definition.
    { name: 'get_collection', description: 'Get a collection by ID. Returns collection metadata and the icons it contains.', inputSchema: { type: 'object', properties: { collection_id: { type: 'number', description: 'The unique ID of the collection', }, thumbnail_size: { type: 'number', enum: [42, 84, 200], description: 'Thumbnail size to return for icons (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 icons to return from the collection', }, }, required: ['collection_id'], }, },
  • Defines the TypeScript interface for input parameters to the getCollection function.
    export interface GetCollectionParams { collection_id: number; thumbnail_size?: 42 | 84 | 200; include_svg?: 0 | 1; limit?: number; }
  • Core handler function that executes the 'get_collection' logic by constructing an OAuth-signed GET request to the Noun Project API's /v2/collection/{collection_id} endpoint and returns the response data.
    async getCollection(params: GetCollectionParams) { const { collection_id, ...rest } = params; const queryParams = new URLSearchParams( Object.fromEntries( Object.entries(rest) .filter(([_, v]) => v !== undefined) .map(([k, v]) => [k, String(v)]) ) ); const queryString = queryParams.toString(); const url = `${BASE_URL}/v2/collection/${collection_id}${ queryString ? `?${queryString}` : '' }`; const headers = this.oauth.getHeaders(url); const response = await this.client.get(`/v2/collection/${collection_id}`, { params: queryParams.toString() ? Object.fromEntries(queryParams) : undefined, headers, }); return response.data; }
  • MCP server tool call handler that dispatches 'get_collection' requests to the api.getCollection method and formats the response as MCP content.
    case 'get_collection': { const result = await api.getCollection(args as any); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }

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