Skip to main content
Glama

get_due_cards

Retrieve a specified number of Anki flashcards due for review to manage study sessions and track progress.

Instructions

Returns a given number (num) of cards due for review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numYesNumber of due cards to get

Implementation Reference

  • Handler for the 'get_due_cards' tool. It retrieves due cards using the helper findCardsAndOrder with query 'is:due', slices the first 'num' cards, and returns them as JSON string in the response content.
    case "get_due_cards": {
      const num = Number(args.num);
    
      const cards = await findCardsAndOrder("is:due");
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(cards.slice(0, num))
        }]
      };
    }
  • index.ts:191-204 (registration)
    Registration of the 'get_due_cards' tool in the ListTools response, including name, description, and input schema requiring a 'num' parameter.
    {
      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"]
      },
    },
  • Input schema for the 'get_due_cards' tool, defining an object with a required 'num' number property.
    inputSchema: {
      type: "object",
      properties: {
        num: {
          type: "number",
          description: "Number of due cards to get"
        }
      },
      required: ["num"]
    },
  • Helper function used by the handler to find cards matching the query (e.g., 'is:due'), fetch their info, clean question and answer fields, and sort by due date.
    async function findCardsAndOrder(query: string): Promise<Card[]> {
      const cardIds = await client.card.findCards({
        query: formatQuery(query)
      });
      const cards: Card[] = (await client.card.cardsInfo({ cards: cardIds })).map(card => ({
        cardId: card.cardId,
        question: cleanWithRegex(card.question),
        answer: cleanWithRegex(card.answer),
        due: card.due
      })).sort((a: Card, b: Card) => a.due - b.due);
    
      return cards;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Returns'), but doesn't mention any behavioral traits such as permissions required, rate limits, pagination, or what happens if 'num' exceeds available due cards. The description is minimal and lacks crucial context for safe invocation.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized for a simple tool with one parameter, though it could be slightly more structured by separating purpose from parameter context.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'due for review' means, how cards are selected or ordered, what the return format looks like, or any error conditions. For a tool that presumably interacts with a review system, this leaves significant gaps in understanding its behavior and output.

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%, with the parameter 'num' fully documented in the schema. The description adds marginal value by reinforcing that 'num' represents 'Number of due cards to get', but doesn't provide additional semantics like valid ranges, default behavior, or edge cases beyond what the schema already states.

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 a specific verb ('Returns') and resource ('cards due for review'), and includes the parameter scope ('a given number (num)'). However, it doesn't explicitly distinguish this from sibling tools like 'get_new_cards', which suggests a different type of card retrieval.

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 like 'get_new_cards' or 'update_cards'. It mentions 'due for review' but doesn't clarify what constitutes 'due' cards or when this tool is appropriate compared to other card-related operations.

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