Skip to main content
Glama
latte-chan
by latte-chan

csb_card

Fetch a Commander Spellbook card using its numeric ID to access specific card data from the Scryfall API for Magic: The Gathering.

Instructions

Fetch Commander Spellbook card by numeric ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Handler function that calls CSB.getCard(id) and wraps the result in structuredContent.
    async ({ id }: { id: number }) => {
        const res = await CSB.getCard(id);
        return { structuredContent: res } as any;
    }
  • Input schema defining a positive integer 'id' parameter.
    const csbCardInput = { id: z.number().int().positive() } as const;
  • Registers the 'csb_card' tool with MCP server, including schema and handler.
    server.registerTool(
        "csb_card",
        {
            title: "CSB: Get card",
            description: "Fetch Commander Spellbook card by numeric ID.",
            inputSchema: csbCardInput
        },
        async ({ id }: { id: number }) => {
            const res = await CSB.getCard(id);
            return { structuredContent: res } as any;
        }
    );
  • CSB.getCard utility that fetches card data from Commander Spellbook API endpoint /cards/{id} via getJson helper.
    getCard: (id: number) => getJson(`/cards/${id}`),

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/latte-chan/scryfall-connector'

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