Skip to main content
Glama

List Decks

list_decks

Retrieve all decks in Codecks project management. Optionally include card counts per deck to track project progress and organization.

Instructions

List all decks. Set include_card_counts=True for per-deck counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_card_countsNo

Implementation Reference

  • Tool registration for 'list_decks' - defines the schema (include_card_counts boolean parameter), metadata (title, description), and the handler that calls client.listDecks().
    server.registerTool(
      "list_decks",
      {
        title: "List Decks",
        description: "List all decks. Set include_card_counts=True for per-deck counts.",
        inputSchema: z.object({
          include_card_counts: z.boolean().default(false),
        }),
      },
      async (args) => {
        try {
          const result = await client.listDecks(args.include_card_counts);
          return {
            content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }],
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(finalizeToolResult(handleError(err))),
              },
            ],
          };
        }
      },
    );
  • Handler function for list_decks tool - executes the tool logic by calling client.listDecks() with the include_card_counts argument, wraps result in finalizeToolResult, and handles errors.
    async (args) => {
      try {
        const result = await client.listDecks(args.include_card_counts);
        return {
          content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(finalizeToolResult(handleError(err))),
            },
          ],
        };
      }
    },
  • Input schema definition for list_decks tool - defines include_card_counts as an optional boolean parameter with default value false using zod validation.
    inputSchema: z.object({
      include_card_counts: z.boolean().default(false),
    }),
  • Core implementation of listDecks method in CodecksClient - builds GraphQL-like query, fetches deck data with optional card counts, and transforms response to include card_count property.
    async listDecks(includeCardCounts = false): Promise<Record<string, unknown>> {
      const fields: unknown[] = ["id", "title"];
      if (includeCardCounts) fields.push({ cards: ["id"] });
    
      const result = await query({
        _root: [{ account: [{ decks: fields }] }],
      });
      const decks = this.extractList(result, "decks");
      return {
        decks: decks.map((d) => ({
          ...d,
          card_count: Array.isArray(d.cards) ? (d.cards as unknown[]).length : undefined,
        })),
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only mentions the optional 'include_card_counts' parameter without describing what the tool returns (e.g., format, pagination, permissions needed, or rate limits). For a list operation with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that directly address the tool's function and key parameter. Every word serves a purpose, and it's front-loaded with the main action, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and parameter effect but lacks details on return values, error handling, or integration with siblings, leaving gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter by explaining that setting 'include_card_counts=True' provides 'per-deck counts'. Since schema description coverage is 0% and there's only one parameter, this adequately compensates, though it doesn't detail default behavior or other nuances.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all decks'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_cards' or 'list_projects' beyond the resource name, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_cards' or 'list_projects'. It mentions the 'include_card_counts' parameter but doesn't explain when to set it to true versus false, leaving usage context unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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