Skip to main content
Glama

update_cards

Mark Anki cards as answered and update their ease levels after review sessions to track learning progress.

Instructions

After the user answers cards you've quizzed them on, use this tool to mark them answered and update their ease

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
answersNo

Implementation Reference

  • The handler logic for the 'update_cards' tool within the CallToolRequestSchema handler. It processes the answers array, calls client.card.answerCards, handles success/failure, and returns a confirmation message.
    case "update_cards": {
      const answers = args.answers as { cardId: number; ease: number }[];
      const result = await client.card.answerCards({ answers: answers });
    
      const successfulCards = answers
        .filter((_, index) => result[index])
        .map(card => card.cardId);
      const failedCards = answers.filter((_, index) => !result[index]);
    
      if (failedCards.length > 0) {
        const failedCardIds = failedCards.map(card => card.cardId);
        throw new Error(`Failed to update cards with IDs: ${failedCardIds.join(', ')}`);
      }
    
      return {
        content: [{
          type: "text",
          text: `Updated cards ${successfulCards.join(", ")}`
        }]
      };
    }
  • The input schema and registration for the 'update_cards' tool defined in the ListToolsRequestSchema handler, specifying the expected 'answers' array with cardId and ease.
    {
      name: "update_cards",
      description: "After the user answers cards you've quizzed them on, use this tool to mark them answered and update their ease",
      inputSchema: {
        type: "object",
        properties: {
          answers: {
            type: "array",
            items: {
              type: "object",
              properties: {
                cardId: {
                  type: "number",
                  description: "Id of the card to answer"
                },
                ease: {
                  type: "number",
                  description: "Ease of the card between 1 (Again) and 4 (Easy)"
                }
              }
            }
          }
        },
      }
    },
  • index.ts:145-221 (registration)
    The tool registration occurs in the ListToolsRequestSchema handler where 'update_cards' is listed among available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "update_cards",
            description: "After the user answers cards you've quizzed them on, use this tool to mark them answered and update their ease",
            inputSchema: {
              type: "object",
              properties: {
                answers: {
                  type: "array",
                  items: {
                    type: "object",
                    properties: {
                      cardId: {
                        type: "number",
                        description: "Id of the card to answer"
                      },
                      ease: {
                        type: "number",
                        description: "Ease of the card between 1 (Again) and 4 (Easy)"
                      }
                    }
                  }
                }
              },
            }
          },
          {
            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"]
            }
          },
          {
            name: "get_due_cards",
            description: "Returns a given number (num) of cards due for review.",
            inputSchema: {
              type: "object",
              properties: {
                num: {
                  type: "number",
                  description: "Number of due cards to get"
                }
              },
              required: ["num"]
            },
          },
          {
            name: "get_new_cards",
            description: "Returns a given number (num) of new and unseen cards.",
            inputSchema: {
              type: "object",
              properties: {
                num: {
                  type: "number",
                  description: "Number of new cards to get"
                }
              },
              required: ["num"]
            },
          }
        ]
      };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the action ('mark them answered and update their ease'), implying a mutation operation, but doesn't disclose critical traits like whether this requires specific permissions, if changes are reversible, potential side effects, or any rate limits. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 appropriately sized and front-loaded, consisting of a single, efficient sentence that directly states the tool's purpose and usage context. Every word earns its place, with no redundant or unnecessary information, making it highly concise and well-structured.

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?

Given the tool's complexity as a mutation operation with no annotations, 1 parameter with 0% schema coverage, and no output schema, the description is incomplete. It covers the basic purpose but lacks details on behavioral traits, parameter semantics, and return values, which are essential for safe and effective use. This is inadequate for a tool that modifies data.

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

Parameters2/5

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

The input schema has 1 parameter ('answers') with 0% description coverage, and the description doesn't add any meaning beyond what the schema provides. It mentions 'cards' and 'ease' but doesn't explain the parameter structure, such as what 'answers' array contains or how 'ease' values map to actions. With low schema coverage, the description fails to compensate, leaving parameters poorly documented.

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 tool's purpose with specific verbs ('mark them answered' and 'update their ease') and identifies the resource ('cards'). It distinguishes from siblings like 'add_card', 'get_due_cards', and 'get_new_cards' by focusing on post-quiz updates rather than creation or retrieval. However, it doesn't explicitly name the resource type beyond 'cards', which could be slightly more specific.

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 provides implied usage context by stating 'After the user answers cards you've quizzed them on', which suggests when to use this tool. It doesn't explicitly mention when not to use it or name alternatives, such as whether other tools handle similar updates. The guidance is clear but lacks explicit exclusions or comparisons to sibling tools.

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