Skip to main content
Glama

autocomplete

Complete Magic: The Gathering card names from partial input to speed up searches in the Scryfall MCP Server.

Instructions

Autocomplete card names based on a partial query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYes

Implementation Reference

  • The handler function for the 'autocomplete' tool. It takes a query 'q', calls Scryfall.autocomplete(q), and returns the result as JSON text content.
    async ({ q }: { q: string }): Promise<ToolResult> => { const data: unknown = await Scryfall.autocomplete(q); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; }
  • Zod input schema for the autocomplete tool: requires a string query 'q'.
    const autocompleteParamsShape = { q: z.string() } as const;
  • Registration of the 'autocomplete' tool with MCP server, including name, description, input schema, and handler.
    server.registerTool( "autocomplete", { description: "Autocomplete card names based on a partial query.", inputSchema: autocompleteParamsShape }, async ({ q }: { q: string }): Promise<ToolResult> => { const data: unknown = await Scryfall.autocomplete(q); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] } as any; } );
  • Helper method in Scryfall object that makes API call to Scryfall's /cards/autocomplete endpoint.
    autocomplete: (q: string) => getJson("/cards/autocomplete", { q }),

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