Skip to main content
Glama

autocomplete

Suggests Magic: The Gathering card names as you type to help quickly find specific cards during searches.

Instructions

Autocomplete card names based on a partial query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYes

Implementation Reference

  • The handler function for the autocomplete tool, which calls Scryfall.autocomplete and returns the response as JSON-formatted 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; }
  • Registers the autocomplete tool with the MCP server using server.registerTool, including description and input schema.
    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; } );
  • Zod input schema definition for the autocomplete tool parameters: { q: z.string() }.
    const autocompleteParamsShape = { q: z.string() } as const;
  • Helper method in Scryfall object that performs the actual API call to /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