Skip to main content
Glama
cryppadotta

Scryfall MCP Server

by cryppadotta

get_card_by_name

Retrieve Magic: The Gathering card data by exact English name. Returns JSON with card details, rulings, and pricing information from Scryfall.

Instructions

Retrieve a card by its exact English name, e.g. 'Black Lotus'. Returns the card data in JSON. If multiple cards share that exact name, Scryfall returns one (usually the most relevant printing).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesExact name of the card, e.g. 'Lightning Bolt'

Implementation Reference

  • The main handler function that performs the HTTP fetch to Scryfall API for the exact card name and processes the response.
    async function handleGetCardByName(name: string) {
      // Tilde in URL means 'exact' mode for the card name
      const url = `https://api.scryfall.com/cards/named?exact=${encodeURIComponent(
        name
      )}`;
      const response = await fetch(url);
      return handleScryfallResponse(response);
    }
  • Defines the tool schema including name, description, and input validation schema.
    const GET_CARD_BY_NAME_TOOL: Tool = {
      name: "get_card_by_name",
      description:
        "Retrieve a card by its exact English name, e.g. 'Black Lotus'. Returns the card data in JSON. " +
        "If multiple cards share that exact name, Scryfall returns one (usually the most relevant printing).",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Exact name of the card, e.g. 'Lightning Bolt'"
          }
        },
        required: ["name"]
      }
    };
  • index.ts:186-194 (registration)
    Registers the get_card_by_name tool by including it in the array of tools served to listTools requests.
    const SCRYFALL_TOOLS = [
      SEARCH_CARDS_TOOL,
      GET_CARD_BY_ID_TOOL,
      GET_CARD_BY_NAME_TOOL,
      RANDOM_CARD_TOOL,
      GET_RULINGS_TOOL,
      GET_PRICES_BY_ID_TOOL,
      GET_PRICES_BY_NAME_TOOL
    ] as const;
  • Switch case in the main CallToolRequestSchema handler that routes calls to the specific get_card_by_name handler.
    case "get_card_by_name": {
      const { name } = args as { name: string };
      return await handleGetCardByName(name);
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the exact-name matching requirement, the JSON return format, and the handling of multiple matches (returns one, usually most relevant printing). It doesn't cover error cases like non-existent names or rate limits, but provides solid operational context.

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 perfectly concise and front-loaded: the first sentence states the core purpose, the second adds crucial behavioral details (return format and multi-match handling). Every sentence earns its place with no wasted words, making it easy for an agent to parse quickly.

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?

Given the tool's moderate complexity (single parameter lookup), no annotations, and no output schema, the description does well by explaining the exact-name requirement, return format, and multi-match behavior. It could be more complete by mentioning error cases or authentication needs, but covers the essential context for correct usage.

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%, so the schema already fully documents the single 'name' parameter. The description adds minimal value beyond the schema by reinforcing the exact-name requirement with examples, but doesn't provide additional syntax or format details. This meets the baseline for high schema coverage.

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 specific action ('Retrieve a card') and resource ('by its exact English name'), distinguishing it from siblings like get_card_by_id (which uses ID) and search_cards (which likely handles broader queries). It provides concrete examples ('Black Lotus', 'Lightning Bolt') that reinforce the exact-name requirement.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('by its exact English name') and implies when not to use it (e.g., for non-exact names or IDs). It distinguishes from siblings by specifying the exact-name lookup method, contrasting with get_card_by_id (ID-based) and search_cards (likely fuzzy or broader search).

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/cryppadotta/scryfall-mcp'

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