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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/mcp-server.ts:268-271 (handler)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; }
- src/mcp-server.ts:260-260 (schema)Input schema for get_rulings: requires a UUID string for the card ID.const getRulingsParamsShape = { id: z.string().uuid() } as const;
- src/mcp-server.ts:262-272 (registration)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; } );
- src/scryfall.ts:107-107 (helper)Helper method in Scryfall object that fetches rulings for a card ID via Scryfall API.getRulingsById: (id: string) => getJson(`/cards/${encodeURIComponent(id)}/rulings`)