Skip to main content
Glama

get_rulings

Retrieve official rulings for Magic: The Gathering cards using Scryfall UUIDs 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

  • Handler function for get_rulings tool: fetches rulings via Scryfall helper and returns JSON-formatted response.
    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 for get_rulings: requires a UUID string for the card ID.
    const getRulingsParamsShape = { id: z.string().uuid() } as const;
  • Registration of the get_rulings tool with MCP server, including description, schema, and 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 in Scryfall object that fetches rulings for a card ID via Scryfall API.
    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