Skip to main content
Glama

Add to Hand

add_to_hand

Add project cards to your hand for immediate management by providing their UUIDs. This tool helps organize workflow items for active processing within the Codecks project management system.

Instructions

Add cards to the user's hand.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
card_idsYesFull 36-char UUIDs

Implementation Reference

  • Tool registration and handler for 'add_to_hand'. Registers the MCP tool with title, description, and zod schema (card_ids array). The handler validates UUIDs, calls client.addToHand(), formats the result, and handles errors.
    server.registerTool(
      "add_to_hand",
      {
        title: "Add to Hand",
        description: "Add cards to the user's hand.",
        inputSchema: z.object({
          card_ids: z.array(z.string()).describe("Full 36-char UUIDs"),
        }),
      },
      async (args) => {
        try {
          validateUuidList(args.card_ids);
          const result = await client.addToHand(args.card_ids);
          return {
            content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }],
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(finalizeToolResult(handleError(err))),
              },
            ],
          };
        }
      },
    );
  • Core implementation of addToHand in CodecksClient class. Iterates through card IDs and dispatches 'hand-cards/add' API call for each, returning success count.
    async addToHand(cardIds: string[]): Promise<Record<string, unknown>> {
      const results = [];
      for (const id of cardIds) {
        const r = await dispatch("hand-cards/add", { cardId: id });
        results.push(r);
      }
      return { ok: true, added: cardIds.length };
    }
  • Zod input schema defining the tool's expected input structure - an array of card_ids (strings) described as full 36-char UUIDs.
    inputSchema: z.object({
      card_ids: z.array(z.string()).describe("Full 36-char UUIDs"),
    }),
  • UUID validation helpers used by the handler. validateUuid checks for 36-char string with 4 hyphens; validateUuidList applies this check to each value in an array.
    export function validateUuid(value: string, field = "card_id"): string {
      if (typeof value !== "string" || value.length !== 36 || (value.match(/-/g) ?? []).length !== 4) {
        throw new CliError(
          `[ERROR] ${field} must be a full 36-char UUID, got: ${JSON.stringify(value)}`,
        );
      }
      return value;
    }
    
    export function validateUuidList(values: string[], field = "card_ids"): string[] {
      return values.map((v) => validateUuid(v, field));
    }
  • registerHandTools function that exports the registration of all hand-related tools (list_hand, add_to_hand, remove_from_hand) with the MCP server.
    export function registerHandTools(server: McpServer, client: CodecksClient): void {
      server.registerTool(
        "list_hand",
        {
          title: "List Hand",
          description: "List cards in the user's hand (personal work queue), sorted by hand order.",
          inputSchema: z.object({}),
        },
        async () => {
          try {
            const result = await client.listHand();
            const sanitized = result.map((c) => sanitizeCard(slimCard(c)));
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(finalizeToolResult(sanitized)),
                },
              ],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(finalizeToolResult(handleError(err))),
                },
              ],
            };
          }
        },
      );
    
      server.registerTool(
        "add_to_hand",
        {
          title: "Add to Hand",
          description: "Add cards to the user's hand.",
          inputSchema: z.object({
            card_ids: z.array(z.string()).describe("Full 36-char UUIDs"),
          }),
        },
        async (args) => {
          try {
            validateUuidList(args.card_ids);
            const result = await client.addToHand(args.card_ids);
            return {
              content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(finalizeToolResult(handleError(err))),
                },
              ],
            };
          }
        },
      );
    
      server.registerTool(
        "remove_from_hand",
        {
          title: "Remove from Hand",
          description: "Remove cards from the user's hand.",
          inputSchema: z.object({
            card_ids: z.array(z.string()).describe("Full 36-char UUIDs"),
          }),
        },
        async (args) => {
          try {
            validateUuidList(args.card_ids);
            const result = await client.removeFromHand(args.card_ids);
            return {
              content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(finalizeToolResult(handleError(err))),
                },
              ],
            };
          }
        },
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Add') but doesn't explain what happens—e.g., whether this is a mutation, if it requires permissions, if cards are duplicated or moved, or what the expected outcome is. This leaves critical behavioral traits unspecified for a tool that likely modifies state.

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 a single, direct sentence with zero wasted words—it's front-loaded and efficiently conveys the core action. Every part of the sentence earns its place by specifying what's being added and where.

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

Completeness2/5

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

Given the complexity (a mutation tool with no annotations and no output schema), the description is incomplete. It doesn't address behavioral aspects like side effects, error conditions, or return values, leaving gaps that could hinder an AI agent's ability to use it correctly in context with siblings like 'remove_from_hand'.

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

Parameters3/5

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

The description doesn't add any meaning beyond the input schema, which has 100% coverage and fully documents the single parameter 'card_ids' as an array of UUIDs. Since schema coverage is high, the baseline score is 3, as the description doesn't compensate but also doesn't detract from the schema's documentation.

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 action ('Add') and resource ('cards to the user's hand'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_card' (which might create new cards) or 'remove_from_hand' (the inverse operation), so it doesn't fully distinguish from alternatives.

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. For example, it doesn't specify if this is for adding existing cards (as implied by 'card_ids') versus creating new ones, or mention prerequisites like cards needing to be in a deck first. There's no explicit context or exclusions provided.

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