Skip to main content
Glama

Create Card

create_card

Create new cards in Codecks project management with configurable properties like title, content, deck assignment, and hierarchical nesting options.

Instructions

Create a new card. Set deck/project to place it. Use parent to nest as sub-card.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesCard title (max 500 chars)
contentNoCard body. Use '- []' for checkboxes
deckNoDestination deck name
projectNo
severityNo
docNoTrue for doc card
allow_duplicateNo
parentNoParent card UUID for sub-cards

Implementation Reference

  • Complete MCP tool registration for 'create_card', including Zod input schema validation (lines 25-34) and the async handler function (lines 36-62) that validates inputs and calls client.createCard()
    export function registerMutationTools(server: McpServer, client: CodecksClient): void {
      server.registerTool(
        "create_card",
        {
          title: "Create Card",
          description:
            "Create a new card. Set deck/project to place it. Use parent to nest as sub-card.",
          inputSchema: z.object({
            title: z.string().describe("Card title (max 500 chars)"),
            content: z.string().optional().describe("Card body. Use '- []' for checkboxes"),
            deck: z.string().optional().describe("Destination deck name"),
            project: z.string().optional(),
            severity: z.enum(["critical", "high", "low", "null"]).optional(),
            doc: z.boolean().default(false).describe("True for doc card"),
            allow_duplicate: z.boolean().default(false),
            parent: z.string().optional().describe("Parent card UUID for sub-cards"),
          }),
        },
        async (args) => {
          try {
            const title = validateInput(args.title, "title");
            const content = args.content ? validateInput(args.content, "content") : undefined;
            const result = await client.createCard({
              title,
              content,
              deck: args.deck,
              project: args.project,
              severity: args.severity,
              doc: args.doc,
              allowDuplicate: args.allow_duplicate,
              parent: args.parent,
            });
            return {
              content: [{ type: "text", text: JSON.stringify(finalizeToolResult(result)) }],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(finalizeToolResult(handleError(err))),
                },
              ],
            };
          }
        },
      );
  • Core implementation of createCard method that constructs the payload with title/content, handles severity and doc card type, dispatches to 'cards/create' API endpoint, and returns the created card ID
    async createCard(options: {
      title: string;
      content?: string;
      deck?: string;
      project?: string;
      severity?: string;
      doc?: boolean;
      allowDuplicate?: boolean;
      parent?: string;
    }): Promise<Record<string, unknown>> {
      const payload: Record<string, unknown> = {
        content: `# ${options.title}${options.content ? "\n\n" + options.content : ""}`,
      };
      if (options.severity && options.severity !== "null") {
        payload.severity = options.severity;
      }
      if (options.doc) payload.cardType = "doc";
    
      const result = await dispatch("cards/create", payload);
      const cardId = (result.payload as Record<string, unknown>)?.id ?? result.cardId ?? "unknown";
    
      return { ok: true, card_id: cardId, title: options.title };
    }
  • Input validation helper function used by create_card handler to sanitize text and enforce maximum length limits
    export function validateInput(text: string, field: string): string {
      if (typeof text !== "string") {
        throw new CliError(`[ERROR] ${field} must be a string`);
      }
      const cleaned = text.replace(CONTROL_RE, "");
      const limit = INPUT_LIMITS[field] ?? 50_000;
      if (cleaned.length > limit) {
        throw new CliError(`[ERROR] ${field} exceeds maximum length of ${limit} characters`);
      }
      return cleaned;
    }
  • dispatch function that routes API requests to the backend, used by createCard to send 'cards/create' commands
    export async function dispatch(path: string, data: unknown): Promise<Record<string, unknown>> {
      return sessionRequest(`/dispatch/${path}`, data);
    }
  • finalizeToolResult helper that normalizes the tool response format, used to format create_card results before returning to MCP client
    export function finalizeToolResult(result: unknown): unknown {
      if (result !== null && typeof result === "object" && !Array.isArray(result)) {
        const dict = result as Record<string, unknown>;
        const normalized = ensureContractDict(dict);
    
        if (normalized.ok === false) return normalized;
    
        if (config.mcpResponseMode === "envelope") {
          const data = { ...normalized };
          delete data.ok;
          delete data.schema_version;
          return {
            ok: true,
            schema_version: CONTRACT_SCHEMA_VERSION,
            data,
          };
        }
    
        return normalized;
      }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Create a new card' which implies a write/mutation operation, but doesn't disclose behavioral traits like required permissions, whether creation is idempotent, error handling, or rate limits. The description adds minimal context beyond the basic action, leaving significant gaps in transparency.

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 front-loaded with the core purpose and uses two concise sentences to add key usage details. Every sentence earns its place by providing essential information without waste, making it efficiently structured and easy to parse.

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 of an 8-parameter mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects, doesn't explain return values or errors, and leaves parameters like 'severity' and 'allow_duplicate' unexplained. For a tool of this nature, more comprehensive guidance is needed.

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?

Schema description coverage is 63%, with parameters like 'project' and 'allow_duplicate' lacking descriptions in the schema. The description adds value by explaining 'deck/project' for placement and 'parent' for nesting, but doesn't cover all parameters or provide deeper semantics for undocumented ones like 'severity' or 'allow_duplicate'. This partially compensates but doesn't fully bridge the coverage gap.

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 ('Create') and resource ('card'), specifying it's a new card. It distinguishes from siblings like 'update_cards' or 'archive_card' by focusing on creation. However, it doesn't explicitly differentiate from 'scaffold_feature' or other creation-like tools, keeping it at 4 rather than 5.

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

Usage Guidelines3/5

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

The description implies usage by mentioning 'Set deck/project to place it' and 'Use parent to nest as sub-card', suggesting context for placement. However, it lacks explicit guidance on when to use this tool versus alternatives like 'scaffold_feature' or prerequisites, leaving usage somewhat implied rather than clearly defined.

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