Skip to main content
Glama
cryppadotta

Scryfall MCP Server

by cryppadotta

random_card

Retrieve a random Magic: The Gathering card from Scryfall's database. Get JSON data with card details, rulings, and pricing information for gameplay or collection purposes.

Instructions

Retrieve a random Magic card from Scryfall. Returns JSON data for that random card.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the random_card tool, which fetches a random card from the Scryfall API endpoint and processes the response using handleScryfallResponse.
    async function handleRandomCard() {
      const url = "https://api.scryfall.com/cards/random";
      const response = await fetch(url);
      return handleScryfallResponse(response);
    }
  • Tool schema definition for random_card, including name, description, and inputSchema with no required parameters.
    const RANDOM_CARD_TOOL: Tool = {
      name: "random_card",
      description:
        "Retrieve a random Magic card from Scryfall. Returns JSON data for that random card.",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    };
  • index.ts:186-194 (registration)
    Registration of the random_card tool (as RANDOM_CARD_TOOL) 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:386-388 (registration)
    Routing/registration in the CallToolRequestSchema switch statement that invokes the random_card handler.
    case "random_card": {
      return await handleRandomCard();
    }
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 ('JSON data') and the source ('Scryfall'), but lacks details on behavioral traits like rate limits, error handling, or whether the randomness is truly uniform. It adds some context but misses key operational aspects.

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 front-loaded and highly efficient, using two sentences that directly state the action, source, and output without any wasted words. Every sentence adds essential information, making it easy to understand at a glance.

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 simplicity (0 parameters, no output schema, no annotations), the description is nearly complete for its purpose. It covers what the tool does and the return format, but could improve by mentioning potential limitations like network dependencies or example use cases, slightly reducing completeness.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, maintaining focus on the tool's purpose. A baseline of 4 is applied as it compensates well for the lack of parameters by clarifying the action.

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 random Magic card') and resource ('from Scryfall'), distinguishing it from siblings like get_card_by_id or search_cards by emphasizing randomness. It directly communicates the tool's unique function without ambiguity.

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

Usage Guidelines4/5

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

The description implies usage context by specifying 'random' retrieval, which suggests it should be used when a non-specific card is needed versus siblings that target specific cards. However, it lacks explicit guidance on when not to use it or direct alternatives, such as preferring search_cards for filtered results.

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