Skip to main content
Glama

add_card

Create flashcards in Anki using HTML formatting for front and back content to support spaced repetition learning.

Instructions

Create a new flashcard in Anki for the user. Must use HTML formatting only. IMPORTANT FORMATTING RULES:

  1. Must use HTML tags for ALL formatting - NO markdown

  2. Use for ALL line breaks

  3. For code blocks, use with inline CSS styling

  4. Example formatting:

    • Line breaks:

    • Code:

    • Lists: and tags

    • Bold:

    • Italic:

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frontYesThe front of the card. Must use HTML formatting only.
backYesThe back of the card. Must use HTML formatting only.

Implementation Reference

  • Executes the add_card tool: creates a new Anki note with HTML-formatted front and back content in the Default deck (Basic model), adds it via client.note.addNote, retrieves the cardId via query on noteId, returns confirmation.
    case "add_card": {
      const front = String(args.front);
      const back = String(args.back);
    
      const note = {
        note: {
          deckName: 'Default',
          fields: {
            Back: back,
            Front: front,
          },
          modelName: 'Basic',
        },
      };
    
      const noteId = await client.note.addNote(note);
      const cardId = (await client.card.findCards({ query: `nid:${noteId}` }))[0];
    
      return {
        content: [{
          type: "text",
          text: `Created card with id ${cardId}`
        }]
      };
    }
  • index.ts:173-190 (registration)
    Tool registration including name, detailed description with HTML formatting instructions, and input schema defining required 'front' and 'back' string properties.
    {
      name: "add_card",
      description: "Create a new flashcard in Anki for the user. Must use HTML formatting only. IMPORTANT FORMATTING RULES:\n1. Must use HTML tags for ALL formatting - NO markdown\n2. Use <br> for ALL line breaks\n3. For code blocks, use <pre> with inline CSS styling\n4. Example formatting:\n   - Line breaks: <br>\n   - Code: <pre style=\"background-color: transparent; padding: 10px; border-radius: 5px;\">\n   - Lists: <ol> and <li> tags\n   - Bold: <strong>\n   - Italic: <em>",
      inputSchema: {
        type: "object",
        properties: {
          front: {
            type: "string",
            description: "The front of the card. Must use HTML formatting only."
          },
          back: {
            type: "string",
            description: "The back of the card. Must use HTML formatting only."
          }
        },
        required: ["front", "back"]
      }
    },
  • Input schema for add_card tool, specifying object with required 'front' and 'back' fields as strings, with descriptions emphasizing HTML-only formatting.
    inputSchema: {
      type: "object",
      properties: {
        front: {
          type: "string",
          description: "The front of the card. Must use HTML formatting only."
        },
        back: {
          type: "string",
          description: "The back of the card. Must use HTML formatting only."
        }
      },
      required: ["front", "back"]
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool creates a new flashcard (implying mutation) and specifies critical formatting rules, but does not cover other behavioral aspects such as permissions, error handling, or what happens on success/failure. It adds some context but is incomplete for a mutation tool.

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

Conciseness4/5

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

The description is front-loaded with the core purpose, followed by detailed formatting rules in a structured list. It is appropriately sized, but the formatting rules section is somewhat lengthy; every sentence earns its place by clarifying critical constraints, though it could be more streamlined.

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

Completeness3/5

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

Given the tool's complexity (a mutation tool with no annotations and no output schema), the description covers the purpose and formatting rules well but lacks information on behavioral traits like response format, error conditions, or prerequisites. It is adequate but has clear gaps for a creation tool.

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 schema description coverage is 100%, so the schema already documents both parameters (front and back) with descriptions. The description adds value by emphasizing HTML formatting rules that apply to these parameters, but does not provide additional semantic details beyond what the schema offers, aligning with the baseline for high coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Create a new flashcard in Anki') and identifies the resource ('flashcard'), distinguishing it from sibling tools like get_due_cards, get_new_cards, and update_cards which are retrieval or modification operations rather than creation.

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

Usage Guidelines3/5

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

The description implies usage by specifying 'for the user' and formatting requirements, but does not explicitly state when to use this tool versus alternatives like update_cards or when not to use it. It provides context but lacks clear exclusions or direct sibling comparisons.

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

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

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