Skip to main content
Glama

api_reflect

Retrieve and reflect all actions or specific scopes within the Anki MCP server for API integration and resource management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionsNoList of action names to reflect, or null for all
scopesYesScopes to reflect

Implementation Reference

  • Full registration of the 'api_reflect' MCP tool, including descriptive comment, Zod input schema (actions and scopes parameters), and async handler function that proxies to ankiClient.miscellaneous.apiReflect() and formats the reflection data as text content.
    // Tool: Get API reflection information server.tool( 'api_reflect', { actions: z .array(z.string()) .nullable() .optional() .describe('List of action names to reflect, or null for all'), scopes: z.array(z.enum(['actions'])).describe('Scopes to reflect'), }, async ({ actions = null, scopes }) => { try { const reflection = await ankiClient.miscellaneous.apiReflect({ actions, scopes }); return { content: [ { type: 'text', text: `API reflection: ${JSON.stringify(reflection, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get API reflection: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • The core handler function for the 'api_reflect' tool. It calls the underlying AnkiConnect apiReflect method via ankiClient, stringifies the result, and returns it as MCP text content. Includes error handling.
    async ({ actions = null, scopes }) => { try { const reflection = await ankiClient.miscellaneous.apiReflect({ actions, scopes }); return { content: [ { type: 'text', text: `API reflection: ${JSON.stringify(reflection, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get API reflection: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod schema defining the input parameters for the 'api_reflect' tool: optional nullable array of action names, and array of scopes (limited to 'actions').
    { actions: z .array(z.string()) .nullable() .optional() .describe('List of action names to reflect, or null for all'), scopes: z.array(z.enum(['actions'])).describe('Scopes to reflect'), },
  • 'apiReflect' is listed as a supported action in the 'multi' tool's enum, allowing it to be used in batch operations.
    'apiReflect',

Other Tools

Related Tools

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/arielbk/anki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server