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