get_mcp_server_attributes
Retrieve available attributes for filtering MCP servers in the Glama MCP directory, enabling precise search and exploration through the Glama MCP API.
Instructions
Get available attributes that can be used to filter MCP servers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:130-137 (handler)The execute function that makes a request to the Glama API endpoint '/v1/attributes' to retrieve available filtering attributes for MCP servers and returns the JSON response or an error message.execute: async () => { try { const result = await makeGlamaRequest("/v1/attributes"); return JSON.stringify(result, null, 2); } catch (error) { return `Error getting MCP server attributes: ${error instanceof Error ? error.message : String(error)}`; } },
- src/server.ts:139-139 (schema)Parameters schema defined as an empty Zod object, indicating the tool takes no input arguments.parameters: z.object({}),
- src/server.ts:122-140 (registration)Registers the 'get_mcp_server_attributes' tool using server.addTool(), including annotations, description, execute handler, name, and parameters schema.server.addTool({ annotations: { openWorldHint: true, readOnlyHint: true, title: "Get MCP Server Attributes", }, description: "Get available attributes that can be used to filter MCP servers", execute: async () => { try { const result = await makeGlamaRequest("/v1/attributes"); return JSON.stringify(result, null, 2); } catch (error) { return `Error getting MCP server attributes: ${error instanceof Error ? error.message : String(error)}`; } }, name: "get_mcp_server_attributes", parameters: z.object({}), });
- src/server.ts:13-36 (helper)The makeGlamaRequest helper function used by the tool (and others) to perform authenticated? API requests to the Glama MCP API base URL with optional query parameters.async function makeGlamaRequest( endpoint: string, params?: Record<string, string>, ) { const url = new URL(`${GLAMA_API_BASE}${endpoint}`); if (params) { Object.entries(params).forEach(([key, value]) => { if (value) { url.searchParams.append(key, value); } }); } const response = await fetch(url.toString()); if (!response.ok) { throw new Error( `API request failed: ${response.status} ${response.statusText}`, ); } return response.json(); }