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

search_cards

Search Magic: The Gathering cards using Scryfall's full-text syntax to find specific cards, art variants, or printings with customizable filters and sorting options.

Instructions

Search cards using Scryfall's powerful full-text syntax.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesScryfall search query, e.g., 't:creature cmc<=3'
uniqueNo
orderNo
dirNo
pageNo
include_extrasNo
include_multilingualNo
include_variationsNo

Implementation Reference

  • The handler function for the 'search_cards' tool. It takes search parameters, calls Scryfall.searchCards, and returns the raw JSON response as text content.
    async (params: SearchParams): Promise<ToolResult> => {
        const data: unknown = await Scryfall.searchCards(params);
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any;
    }
  • Zod shape defining the input schema for the search_cards tool, matching Scryfall's SearchParams.
    const searchParamsShape = {
        q: z.string().describe("Scryfall search query, e.g., 't:creature cmc<=3'"),
        unique: z.enum(["cards", "art", "prints"]).optional(),
        order: z
            .enum([
                "name",
                "set",
                "released",
                "rarity",
                "color",
                "usd",
                "tix",
                "eur",
                "cmc",
                "power",
                "toughness",
                "edhrec",
                "penny",
                "artist",
                "review"
            ])
            .optional(),
        dir: z.enum(["auto", "asc", "desc"]).optional(),
        page: z.number().int().min(1).optional(),
        include_extras: z.boolean().optional(),
        include_multilingual: z.boolean().optional(),
        include_variations: z.boolean().optional()
    } as const;
  • Registration of the 'search_cards' tool with the MCP server, including name, schema, description, and handler.
    server.registerTool(
        "search_cards",
        {
            description: "Search cards using Scryfall's powerful full-text syntax.",
            inputSchema: searchParamsShape
        },
        async (params: SearchParams): Promise<ToolResult> => {
            const data: unknown = await Scryfall.searchCards(params);
            return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any;
        }
    );
  • The Scryfall.searchCards helper method that makes the API request to /cards/search endpoint.
    searchCards: (opts: SearchParams) => getJson("/cards/search", opts),
  • TypeScript type definition for SearchParams used by the searchCards method and tool input.
    export type SearchParams = {
        q: string;
        unique?: "cards" | "art" | "prints";
        order?:
        | "name"
        | "set"
        | "released"
        | "rarity"
        | "color"
        | "usd"
        | "tix"
        | "eur"
        | "cmc"
        | "power"
        | "toughness"
        | "edhrec"
        | "penny"
        | "artist"
        | "review";
        dir?: "auto" | "asc" | "desc";
        page?: number;
        include_extras?: boolean;
        include_multilingual?: boolean;
        include_variations?: boolean;
    };
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 mentions 'Scryfall's powerful full-text syntax' which hints at the search capability, but doesn't describe what the tool returns (e.g., paginated results, error behavior, rate limits, or authentication needs). For a search tool with 8 parameters and no output schema, this leaves significant gaps in understanding how it behaves.

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, efficient sentence with zero waste. It's appropriately sized and front-loaded with the core purpose. Every word earns its place without being overly verbose or under-specified in terms of structure.

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 (8 parameters, low schema coverage of 13%, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how to handle pagination, error conditions, or the purpose of most parameters. For a search tool with many configuration options, this leaves too much unspecified for effective agent use.

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

Parameters2/5

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

Schema description coverage is only 13% (only the 'q' parameter has a description), so the description must compensate but doesn't. It mentions 'Scryfall's powerful full-text syntax' which relates to the 'q' parameter, but doesn't explain the semantics of the other 7 parameters (like 'unique', 'order', 'dir', etc.). The description adds minimal value beyond what little is in the schema.

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 tool's purpose: 'Search cards using Scryfall's powerful full-text syntax.' It specifies the verb ('search') and resource ('cards'), and mentions the search engine (Scryfall). However, it doesn't explicitly differentiate this from sibling tools like 'search_by_art_tag' or 'search_by_format', which appear to be more specialized search variants.

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. With many sibling search tools (e.g., 'search_by_art_tag', 'search_by_format', 'search_by_colors'), there's no indication that this is the general-purpose search tool or when to choose it over more specific ones. The description lacks any 'when' or 'when not' context.

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

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