Skip to main content
Glama

Retrieve a card

lob_cards_get
Read-onlyIdempotent

Retrieve a single card's details using its unique card ID.

Instructions

Retrieve a single card by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCard ID (`card_…`).

Implementation Reference

  • Handler for lob_cards_get: makes a GET request to Lob's /cards/{id} endpoint using the provided card ID.
    registerTool(server, {
      name: "lob_cards_get",
      annotations: { title: "Retrieve a card", ...ToolAnnotationPresets.read },
      description: "Retrieve a single card by ID.",
      inputSchema: { id: CARD_ID },
      handler: async ({ id }) =>
        lob.request({ method: "GET", path: `/cards/${id}` }),
    });
  • Input schema for lob_cards_get: expects a single 'id' parameter validated as a string matching the /^card_/ pattern.
    const BUCKSLIP_ID = z.string().regex(/^bck_/).describe("Buckslip ID (`bck_…`).");
    const CARD_ID = z.string().regex(/^card_/).describe("Card ID (`card_…`).");
  • Registration of the 'lob_cards_get' tool via registerTool helper, which calls server.registerTool with the schema and handler.
    registerTool(server, {
      name: "lob_cards_get",
      annotations: { title: "Retrieve a card", ...ToolAnnotationPresets.read },
      description: "Retrieve a single card by ID.",
      inputSchema: { id: CARD_ID },
      handler: async ({ id }) =>
        lob.request({ method: "GET", path: `/cards/${id}` }),
    });
  • The registerTool helper function that wraps the MCP SDK's server.registerTool with consistent error handling and JSON formatting.
    export function registerTool<TShape extends ZodRawShape>(
      server: McpServer,
      def: ToolDefinition<TShape>,
    ): void {
      const a = def.annotations ?? {};
      server.registerTool(
        def.name,
        {
          title: a.title ?? def.name,
          description: def.description,
          inputSchema: def.inputSchema,
          annotations: {
            ...a,
            // Lob is always external; default the hint accordingly.
            openWorldHint: a.openWorldHint ?? true,
          },
        },
        // The SDK's ToolCallback type is parameterised over the exact ZodRawShape and
        // resists the generic erasure here. The runtime contract (validated args in,
        // CallToolResult out) is correct, so we bridge the type boundary with `as never`.
        (async (args: unknown, serverCtx: unknown): Promise<CallToolResult> => {
          try {
            const result = await def.handler(args as never, serverCtx);
            return { content: [{ type: "text", text: stringifyResult(result) }] };
          } catch (err) {
            return {
              isError: true,
              content: [{ type: "text", text: formatErrorForTool(err) }],
            };
          }
        }) as never,
      );
    }
Behavior2/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds no behavioral context beyond 'Retrieve a single card', which is already clear from the name. Since it fails to add value beyond annotations, it scores low.

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?

A single, front-loaded sentence with no wasted words. It is maximally efficient and easily parsed.

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

Completeness4/5

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

For a simple single-parameter retrieval tool with full annotation coverage, the description is nearly complete. It could optionally mention the return type, but the absence does not hinder agent understanding given the simplicity.

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 100% with a clear pattern and description for the 'id' parameter. The description does not add additional meaning beyond 'by ID', so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the action ('Retrieve'), the resource ('a single card'), and the method ('by ID'). It distinguishes from sibling tools like lob_cards_list (multiple) and lob_cards_create (create), so the purpose is unambiguous.

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 does not explicitly state when to use this tool versus alternatives. It is implied by the name and siblings, but no direct guidance is provided, scoring at the adequate baseline.

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/optimize-overseas/lob-mcp'

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