Skip to main content
Glama

get_rulings

Retrieve official rulings for Magic: The Gathering cards using their Scryfall UUID to clarify card interactions and resolve gameplay questions.

Instructions

Get official rulings for a card by Scryfall UUID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • MCP tool handler: fetches rulings by ID using Scryfall helper and serializes to JSON text content.
    async ({ id }: { id: string }): Promise<ToolResult> => { const data: unknown = await Scryfall.getRulingsById(id); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; }
  • Input schema validation: requires a Scryfall UUID string.
    const getRulingsParamsShape = { id: z.string().uuid() } as const;
  • Registers the 'get_rulings' tool with MCP server, including schema and inline handler.
    server.registerTool( "get_rulings", { description: "Get official rulings for a card by Scryfall UUID.", inputSchema: getRulingsParamsShape }, async ({ id }: { id: string }): Promise<ToolResult> => { const data: unknown = await Scryfall.getRulingsById(id); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; } );
  • Helper method on Scryfall object: performs API GET to fetch rulings for card ID.
    getRulingsById: (id: string) => getJson(`/cards/${encodeURIComponent(id)}/rulings`)

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