Skip to main content
Glama
anki-connect-mcp
by SolarianGG

browser.getSelection

browser_getSelection
Read-only

Reads the current Anki browser selection and returns selected note and card IDs; if the browser is closed, reports open=false with empty arrays.

Instructions

Read browser selection; closed browser returns open=false and empty arrays.

Anki-Connect method browser.getSelection. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_getSelection"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionNoOptional. Collection session ID: the `session` field returned by `collection_get`. Usually omit it — the server then uses the session current at the time of the call. Pass it to make the call fail with `staleSession` instead of acting on a different profile/collection than the one your IDs, cursors and tokens came from.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), and the description adds genuinely new behavior: a closed browser yields open=false and empty arrays rather than an error. It also declares scope/collaboration context (collection), that no undo entry is created, and enumerates the four possible error codes, which the annotations do not provide.

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 core behavior is front-loaded in the first sentence and the remaining lines are compact labeled metadata. Minor redundancy: 'Effect: read' and 'Undo: none' restate what readOnlyHint/destructiveHint already convey, but the cost is small.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must carry the return shape, and it does so partially by naming the open field and the empty-array closed state plus the error set. It never says what the arrays contain (selected cards, notes, or rows), which is the one real gap for a zero-parameter read tool.

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?

There is only one optional parameter, and the schema documents it at 100% coverage with a detailed explanation of session semantics and the staleSession failure mode. The description adds nothing about session, so the baseline of 3 applies.

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 states a specific verb and resource ('Read browser selection') and immediately discloses the edge-case outcome for a closed browser, which is more than a restatement of the name. It does not explicitly contrast itself with the sibling tools browser_open and browser_select, so an agent must infer that this one only reads while those change state.

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?

Usage is only implied: the closed-browser note signals this is meant to be called against an open browser, but there is no explicit when-to-use statement or routing to browser_open/browser_select as alternatives. The listed error names (staleSession, collectionUnavailable) hint at preconditions without stating them.

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