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;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations provided. The description only states the function without disclosing behavioral traits such as order, caching, or side effects. Minimal transparency beyond purpose.

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 sentence, concise and direct. However, it could be slightly improved by including additional context without becoming verbose.

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?

No output schema, so the agent lacks information about the return format. The description does not mention ordering, limits, or defaults. For a data-retrieval tool, more completeness is needed.

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 schema already describes the parameter 'num' as 'Number of due cards to get'. The tool description does not add any extra meaning, such as constraints, defaults, or edge cases. Schema coverage is 100% but the description adds no value.

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 specifies the tool returns cards due for review, with a parameter for count. It distinguishes from siblings like get_new_cards (new cards) and update_cards (updates), making the purpose unambiguous.

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?

No explicit guidance on when to use this tool versus alternatives. The description implies usage for retrieving due cards but does not mention when not to use or provide 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.

Deploy Server

Other Tools