Skip to main content
Glama

pilot_page_text

Extract clean text from web pages by removing scripts, styles, and non-essential elements for content analysis and data processing.

Instructions

Extract clean text from the page (strips script/style/noscript/svg).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for 'pilot_page_text' tool, which extracts clean text from the page using a helper function.
    server.tool(
      'pilot_page_text',
      'Extract clean text from the page (strips script/style/noscript/svg).',
      {},
      async () => {
        await bm.ensureBrowser();
        try {
          const text = await getCleanText(bm.getPage());
          return { content: [{ type: 'text' as const, text }] };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );
  • Helper function used by 'pilot_page_text' to clean and extract text from the DOM.
    async function getCleanText(page: import('playwright').Page): Promise<string> {
      return await page.evaluate(() => {
        const body = document.body;
        if (!body) return '';
        const clone = body.cloneNode(true) as HTMLElement;
        clone.querySelectorAll('script, style, noscript, svg').forEach(el => el.remove());
        return clone.innerText
          .split('\n')
          .map(line => line.trim())
          .filter(line => line.length > 0)
          .join('\n');
      });
Behavior4/5

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

With no annotations provided, the description carries the full burden and successfully discloses the content filtering behavior (what gets stripped). Could be improved by mentioning it operates on the current page context and describing the return format (string vs object).

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?

Single dense sentence with zero waste. Front-loads the action ('Extract clean text') and appends the specific stripping behavior parenthetically—excellent structure for immediate comprehension.

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?

Adequate for a zero-parameter tool, but given the absence of an output schema, the description should explicitly state what the tool returns (e.g., 'returns plain text string') rather than only describing the extraction process.

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

Parameters4/5

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

Zero parameters present, meeting the baseline score of 4. No parameter documentation needed.

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?

Uses specific verb 'Extract' with clear resource 'clean text from the page'. The parenthetical '(strips script/style/noscript/svg)' precisely distinguishes this from raw HTML extraction (sibling pilot_page_html) by specifying the sanitization behavior.

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?

Provides implicit guidance through the stripping detail (use when readable text is needed, not markup), but lacks explicit when-to-use/when-not-to-use guidance relative to siblings like pilot_page_html or pilot_page_attrs.

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/TacosyHorchata/Pilot'

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