Skip to main content
Glama

get_selection

Retrieve the text currently selected on a page plus its surrounding passage for context, using a tab ID to target the correct browser tab.

Instructions

Get the text the user currently has selected on the page, with the surrounding passage for context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tabId": "<tabId>"
    },
    "name": "get_selection"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdYesTab ID, from tabs_list or tab_create

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.8

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It does disclose a useful behavioral trait beyond the name: the result includes the surrounding passage for context. However, it omits what happens when nothing is selected (empty result vs. error) and gives no indication of return format or size limits.

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?

One sentence, front-loaded with the primary behavior and ending with the secondary context-passage detail. No filler or redundant restatement of the name.

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?

For a one-parameter read-only tool with no output schema, the description covers what is returned and why. The main remaining gap is edge-case behavior when no selection exists, which an agent would need in order to interpret an empty response correctly.

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% and the single tabId parameter already documents its type and provenance ("from tabs_list or tab_create"). The description adds nothing about the parameter, which is acceptable at this coverage level but not value-adding.

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 pairs a specific verb ("Get") with a precise resource ("the text the user currently has selected on the page") and even specifies the return shape (selection plus surrounding passage). That wording implicitly separates it from whole-page readers like get_page_text, but no sibling is named, so the differentiation is left for the agent to infer.

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: an agent can deduce it should call this when it needs the user's current selection rather than the full page. There is no explicit when-to-use vs. when-not guidance, no mention of alternatives such as get_page_text, and no stated precondition that a tab must be active and have an active selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.