Skip to main content
Glama

select_text

Select a specific substring within an element's text content on any desktop app to format, copy, or replace text precisely.

Instructions

Select a substring within an element's text content.

Finds the text within the element and applies a native text
selection over that range.  Works on editable fields and document
bodies on all backends.  On web content (CDP) and Windows (UIA)
also works on read-only containers such as articles and sections.
Useful for formatting, copying, or replacing specific text.

Args:
    element_id: The element ID containing the text.
    text: The exact substring to select.
    occurrence: Which occurrence to select (1 = first, 2 = second, etc.).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
element_idYes
textYes
occurrenceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses key behavioral traits: 'applies a native text selection over that range,' works on editable fields and document bodies, and on some backends works on read-only containers. It also explains the occurrence parameter. However, it doesn't mention if selection is visible or if it modifies state.

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 compact and well-structured: a one-sentence summary, then two supporting sentences about behavior and use cases, followed by a clear parameter list. Every sentence adds value with no redundancy.

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?

Given the tool's complexity (3 parameters, no annotations, output schema exists), the description covers purpose, usage context, parameter semantics, and backend-specific behavior. It does not explain return values, but the output schema likely handles that. Minor gap: no mention of prerequisites (e.g., element must be focused or visible).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since schema_description_coverage is 0%, the description must compensate. It does so by explaining each parameter: element_id (the element containing text), text (exact substring to select), and occurrence (which occurrence to target), adding meaning beyond the schema's type and name.

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 starts with a clear verb+resource statement: 'Select a substring within an element's text content.' It specifies the exact action and distinguishes from sibling tools like read_text, set_value, and type_text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use, e.g., 'Useful for formatting, copying, or replacing specific text.' It also explains backend-specific behavior (editable vs. read-only) but does not explicitly state when not to use or name alternatives.

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/Touchpoint-Labs/Touchpoint'

If you have feedback or need assistance with the MCP directory API, please join our Discord server