List Tags
list_tagsRetrieve project-level tags from the sanctioned taxonomy to organize and categorize content in Codecks project management workflows.
Instructions
List project-level tags (sanctioned taxonomy).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/read.ts:273-297 (handler)Registration and handler for the 'list_tags' MCP tool. Registers the tool with title 'List Tags', description 'List project-level tags (sanctioned taxonomy).', and an empty input schema. The handler calls client.listTags() and returns the result wrapped in finalizeToolResult().
server.registerTool( "list_tags", { title: "List Tags", description: "List project-level tags (sanctioned taxonomy).", inputSchema: z.object({}), }, async () => { try { const result = await client.listTags(); return { content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }], }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(handleError(err))), }, ], }; } }, ); - src/client.ts:238-243 (handler)Client implementation of listTags() method. Performs a GraphQL query to fetch masterTags with fields id, name, and color from the Codecks API. Uses the extractList helper to parse the response and returns the tags in a { tags: [...] } format.
async listTags(): Promise<Record<string, unknown>> { const result = await query({ _root: [{ account: [{ masterTags: ["id", "name", "color"] }] }], }); return { tags: this.extractList(result, "masterTags") }; } - src/client.ts:671-685 (helper)Helper method extractList() used by listTags to extract arrays from nested GraphQL response structures. Navigates through the result object to find and return the array at the specified key (e.g., 'masterTags').
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 []; }