Skip to main content
Glama

list_projects

Retrieve all projects with deck information from Codecks to manage project workflows and track progress.

Instructions

List all projects with deck info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the list_projects MCP tool with title 'List Projects', description 'List all projects with deck info.', and empty input schema. The handler calls client.listProjects() and returns the result as JSON content.
    server.registerTool( "list_projects", { title: "List Projects", description: "List all projects with deck info.", inputSchema: z.object({}), }, async () => { try { const result = await client.listProjects(); return { content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }], }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(handleError(err))), }, ], }; } }, );
  • Implementation of listProjects() method that queries the Codecks API for account projects with id, title, and deck info. Returns an object containing the projects list extracted using the extractList helper.
    async listProjects(): Promise<Record<string, unknown>> { const result = await query({ _root: [ { account: [{ projects: ["id", "title", { decks: ["id", "title"] }] }], }, ], }); return { projects: this.extractList(result, "projects") }; }
  • Input schema definition for list_projects tool: z.object({}) - no parameters required.
    inputSchema: z.object({}),
  • The extractList() helper method that recursively searches through a nested result object to find and extract an array by key name. Used by listProjects to extract the projects array from the API response.
    private extractList(result: Record<string, unknown>, key: string): Record<string, unknown>[] { for (const val of Object.values(result)) { if (typeof val === "object" && val !== null) { const obj = val as Record<string, unknown>; if (Array.isArray(obj[key])) return obj[key] as Record<string, unknown>[]; for (const inner of Object.values(obj)) { if (typeof inner === "object" && inner !== null) { const innerObj = inner as Record<string, unknown>; if (Array.isArray(innerObj[key])) return innerObj[key] as Record<string, unknown>[]; } } } } return []; }

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/rangogamedev/codecks-mcp'

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