Skip to main content
Glama

text_clean

Extract and return clean, readable text from a web page by removing scripts, styles, navigation, headers, footers, and other non-content elements. Collapses whitespace and strips JSON.

Instructions

Return chrome-stripped, JSON-stripped, whitespace-collapsed text from a selector or the best content root. Drops script/style/noscript/svg and page chrome (nav/header/footer/aside) plus obvious hidden widgets and repeated boilerplate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_charsNoOptional max characters to return.
selectorNoOptional CSS selector to scope extraction. Default: best content root.
Behavior3/5

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

The description lists elements that are stripped (script, style, nav, header, footer, aside, hidden widgets, repeated boilerplate) and mentions collapsing whitespace. However, with no annotations, it does not fully disclose behavior like whether DOM is modified or if the operation is read-only. The mention of 'best content root' suggests heuristic selection, which is vague.

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?

Two sentences: first states purpose, second details what is dropped. Front-loaded with key action, no filler. Each clause adds specific information.

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

Completeness3/5

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

The description covers the tool's purpose and stripping actions but lacks return value details (beyond 'text'), no output schema, and no side-effect disclosure. For a simple extraction tool, it is marginally adequate but could be more explicit about output format and limitations.

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 coverage is 100% and both parameters have descriptions. The tool description echoes the schema content ('from a selector or the best content root') without adding new semantic detail. Baseline score of 3 applies as no additional value beyond schema.

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 it returns cleaned text with specific strippings (chrome, JSON, script, etc.) and mentions selector or best content root. It implies differentiation from raw text extraction but does not explicitly contrast with siblings like 'text' or 'text_main'.

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?

No explicit guidance on when to use this tool versus alternatives. The description lists what is removed, so an agent might infer suitability for clean text extraction, but there is no mention of when not to use or which sibling to choose.

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/protostatis/unbrowser'

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