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;
    }
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 the tool returns cards but doesn't describe what 'new and unseen' means operationally, whether there are rate limits, authentication requirements, or how the tool handles edge cases (e.g., if 'num' exceeds available cards). The description is minimal and lacks critical behavioral context.

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 a single, efficient sentence with zero waste. It front-loads the core purpose ('Returns...') and includes only essential details. Every word earns its place, making it highly concise and well-structured for quick comprehension.

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 simplicity (1 parameter, no annotations, no output schema), the description is incomplete. It lacks context about what constitutes 'new and unseen', how results are formatted, or any behavioral traits. For a read operation with no structured support, the description should provide more operational guidance to compensate.

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 description coverage is 100%, with the parameter 'num' documented as 'Number of new cards to get'. The description adds no additional meaning beyond this, merely restating that it returns 'a given number (num)'. Since the schema already fully describes the parameter, the baseline score of 3 is appropriate.

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 action ('Returns') and resource ('new and unseen cards'), with specific scope ('a given number'). It distinguishes from siblings like 'get_due_cards' by focusing on new/unseen cards rather than due ones. However, it doesn't explicitly differentiate from 'add_card' or 'update_cards' beyond the verb choice.

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_due_cards' or 'add_card'. It implies usage for retrieving new cards but offers no context about prerequisites, exclusions, or typical scenarios. This leaves the agent without clear decision-making criteria.

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