Skip to main content
Glama

anki_add_note

Add a flashcard to a specified Anki deck by providing the deck name, front, and back content for the note. Integrates with Anki via the AnkiConnect plugin.

Instructions

Add a flashcard to an Anki deck

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backYesBack of the flashcard
deckNameYesThe target deck name
frontYesFront of the flashcard

Implementation Reference

  • src/index.ts:169-172 (registration)
    Registration of the 'addNote' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.
    {
      name: "addNote",
      description: "Create a single note",
      inputSchema: noteParameters,
  • Input schema definition (noteParameters) used by the 'addNote' tool for validating deckName, modelName, fields, and optional tags.
    const noteParameters = {
      type: "object",
      properties: {
        deckName: {
          type: "string",
          description: "Name of the deck to add note to",
        },
        modelName: {
          type: "string",
          description: "Name of the note model/type to use",
        },
        fields: {
          type: "object",
          description: "Map of fields to the value in the note model being used",
        },
        tags: {
          type: "array",
          items: {
            type: "string",
          },
          description: "Tags to apply to the note",
        },
      },
      required: ["deckName", "modelName", "fields"],
    };
  • Handler logic for the 'addNote' tool within the CallToolRequestSchema handler. It wraps arguments in {note: ...} and calls AnkiConnect's 'addNote' action via ankiRequest, returning the created note ID.
    case "addNote":
      const createdNoteId = await ankiRequest<number>(
        "addNote",
        { note: request.params.arguments },
      );
      return {
        toolResult: `Created note with the following ID: ${createdNoteId}`,
      };
  • Helper function 'ankiRequest' used by the 'addNote' handler to make API calls to AnkiConnect at localhost:8765.
    async function ankiRequest<T>(action: string, params: any = {}): Promise<T> {
      const response = await fetch("http://localhost:8765", {
        method: "POST",
        body: JSON.stringify({
          action,
          version: 6,
          params,
        }),
      });
      const { result } = (await response.json()) as AnkiRequestResult<T>;
      return result;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Add') which implies a write/mutation operation, but doesn't disclose any behavioral traits like whether it requires specific permissions, what happens if the deck doesn't exist, error conditions, or how the system responds to successful addition. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single, clear sentence that communicates the core purpose without any wasted words. It's appropriately sized for a straightforward tool and gets directly to the point with no unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what happens after adding the flashcard, potential error conditions, or how to verify success. Given the tool's complexity as a write operation and the lack of structured behavioral information, more context about the operation's behavior and outcomes would be valuable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what's already in the schema, which has 100% coverage with clear descriptions for all three parameters. The baseline score of 3 reflects adequate schema documentation, but the description doesn't provide additional context about parameter relationships, constraints, or usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and resource ('flashcard to an Anki deck'), making the purpose immediately understandable. It distinguishes from sibling 'anki_add_notes' by specifying singular 'flashcard' vs. plural 'notes', but doesn't explicitly differentiate from 'anki_create_deck' which creates decks rather than flashcards.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'anki_add_notes' (for single vs. multiple cards) or 'anki_create_deck' (for creating decks before adding cards). No prerequisites or contextual usage information is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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