Skip to main content
Glama

get_new_cards

Retrieve a specified number of new, unseen flashcards from Anki for review or study sessions.

Instructions

Returns a given number (num) of new and unseen cards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numYesNumber of new cards to get

Implementation Reference

  • Handler function for the 'get_new_cards' tool within the CallToolRequestSchema. It parses the 'num' argument, fetches new cards using the helper findCardsAndOrder with query 'is:new', slices the first N cards, and returns them serialized as JSON text.
    case "get_new_cards": {
      const num = Number(args.num);
    
      const cards = await findCardsAndOrder("is:new");
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(cards.slice(0, num))
        }]
      };
    }
  • index.ts:206-218 (registration)
    Registration of the 'get_new_cards' tool in the ListToolsRequestSchema response, including the tool name, description, and input schema definition.
      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"]
      },
    }
  • Input schema definition for the 'get_new_cards' tool, specifying a required 'num' property of type number.
    inputSchema: {
      type: "object",
      properties: {
        num: {
          type: "number",
          description: "Number of new cards to get"
        }
      },
      required: ["num"]
    },
  • Helper function called by the get_new_cards handler to find cards matching the 'is:new' query, retrieve their details, clean the 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 are provided, so the description carries the full burden of disclosing behavioral traits. It does not mention side effects (e.g., whether the cards are marked as seen), authentication needs, rate limits, or any other behavioral characteristics beyond the basic return action.

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, concise sentence with no wasted words. It is appropriately front-loaded. However, it could be slightly more informative without sacrificing conciseness.

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?

For a simple tool with one parameter and no output schema, the description is adequate. It explains the core function but lacks context about retrieval behavior (e.g., whether cards are returned in a specific order, what happens when fewer cards are available).

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?

Schema coverage for parameter 'num' is 100% (it has a description). The tool description adds minimal meaning beyond the schema, specifying that the parameter controls how many 'new and unseen' cards are returned. However, it does not clarify the selection criteria, ordering, or what 'new' or 'unseen' mean precisely.

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 that the tool 'returns a given number (num) of new and unseen cards.' The verb 'returns' identifies the action, and the resource 'new and unseen cards' distinguishes it from sibling tools like get_due_cards (due cards) and add_card/update_cards (mutations).

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?

No explicit guidance on when to use this tool versus alternatives. The description does not mention when the user should prefer get_new_cards over get_due_cards or other siblings, nor does it provide any context about prerequisites or constraints.

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