Skip to main content
Glama
nbiish

Better Browser MCP

by nbiish

browser_extract_text

Extract visible text from a specific page element using its snapshot reference. Returns normalized plain string without the overhead of a full snapshot.

Instructions

Extract the textContent of a single element by ref. Cheaper than a full snapshot when you just need the visible text of one element. Returns the text as a plain string with whitespace normalized. Use to grab a heading, a status message, or a single field's value without paying the snapshot cost.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesExact target element reference from the page snapshot
tabIdNoOptional tab ID to target. When omitted, routes to the agent's active tab. Use browser_list_tabs to see available tab IDs.
elementYesHuman-readable element description used to obtain permission to interact with the element
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It reveals the operation is read-only ('Extract'), specifies the return format ('plain string with whitespace normalized'), and notes a performance trait ('Cheaper than a full snapshot'). However, it does not describe behavior for invalid refs or when the element is not found, which would be useful but is a minor gap for a read operation.

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 front-loaded: the first sentence presents the core action and object, followed by the efficiency rationale, return behavior, and use-case examples. Every sentence contributes information without redundancy, making it efficient and well-structured.

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

Completeness5/5

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

For a simple read tool, the description integrates purpose, usage guidance, return behavior, and performance context. The schema covers all parameters, and the description states the output format (plain string) even without an output schema. It is sufficiently complete for an agent to select and invoke the tool correctly among its siblings.

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?

The input schema describes all three parameters (ref, tabId, element) with details, achieving 100% coverage. The tool description adds minimal parameter-specific semantics, only reinforcing that the element is selected 'by ref.' Since the schema already handles parameter meaning, 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the exact operation: 'Extract the `textContent` of a single element by ref.' It uses a specific verb and target, and distinguishes itself from the full snapshot by noting it is 'Cheaper than a full snapshot' and returns only one element's text. This clearly differentiates it from sibling tools like browser_snapshot or browser_get_attribute.

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

Usage Guidelines5/5

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

Explicitly states when to use this tool ('when you just need the visible text of one element'), gives concrete use cases ('grab a heading, a status message, or a single field's value'), and contrasts it with the alternative of taking a full snapshot at higher cost. This provides clear selection guidance.

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/nbiish/betterbrowsermcp'

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