Skip to main content
Glama
cryppadotta

Scryfall MCP Server

by cryppadotta

get_prices_by_name

Retrieve Magic: The Gathering card pricing data by exact card name, returning current USD, foil, EUR, and other market values in JSON format.

Instructions

Retrieve price information for a card by its exact name. Returns JSON with usd, usd_foil, eur, tix, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesExact card name

Implementation Reference

  • The handler function that fetches the Scryfall card by exact name and returns its price information in JSON format.
    async function handleGetPricesByName(name: string) {
      const url = `https://api.scryfall.com/cards/named?exact=${encodeURIComponent(
        name
      )}`;
      const response = await fetch(url);
      if (!response.ok) {
        return handleScryfallResponse(response);
      }
      const data = (await response.json()) as ScryfallCard;
    
      if (!data.prices) {
        return {
          content: [
            {
              type: "text",
              text: "No price information found for this card."
            }
          ],
          isError: false
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data.prices, null, 2)
          }
        ],
        isError: false
      };
    }
  • Defines the tool schema, including name, description, and input schema requiring a 'name' string parameter.
    const GET_PRICES_BY_NAME_TOOL: Tool = {
      name: "get_prices_by_name",
      description:
        "Retrieve price information for a card by its exact name. Returns JSON with usd, usd_foil, eur, tix, etc.",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Exact card name"
          }
        },
        required: ["name"]
      }
    };
  • index.ts:186-194 (registration)
    Registers the get_prices_by_name tool by including it in the SCRYFALL_TOOLS array, which is returned by the listTools handler.
    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;
  • index.ts:397-400 (registration)
    Registers the handler for get_prices_by_name tool calls within the switch statement of the CallToolRequestSchema handler.
    case "get_prices_by_name": {
      const { name } = args as { name: string };
      return await handleGetPricesByName(name);
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the return format ('Returns JSON with usd, usd_foil, eur, tix, etc.'), which is useful behavioral context. However, it lacks details on error handling, rate limits, or authentication needs, which are important for a retrieval tool.

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 two sentences that are front-loaded with the core purpose and efficiently add return format details. Every sentence earns its place with no wasted words, making it highly concise and well-structured for quick understanding.

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 low complexity (single parameter, no annotations, no output schema), the description is mostly complete. It covers purpose, parameter hint, and return format, but lacks output schema details (e.g., full JSON structure) and behavioral aspects like errors, which could enhance completeness for the agent.

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 documents the single parameter 'name' with its description. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, but does not contradict it, meeting the baseline for high 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 verb 'Retrieve' and the resource 'price information for a card by its exact name', making the purpose specific and actionable. It distinguishes from siblings like get_card_by_name (which likely returns card details) and get_prices_by_id (which uses ID instead of name), enhancing clarity.

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 specifying 'by its exact name', which suggests when to use this tool over alternatives like get_prices_by_id. However, it does not explicitly state when-not to use it or name specific alternatives, leaving some ambiguity for the agent in selecting between similar tools.

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