Skip to main content
Glama

scrape

Extract text content from any URL for data analysis, research, or content processing using web scraping functionality.

Instructions

Scrape and extract text content from a URL ($0.001)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • index.js:28-28 (registration)
    The 'scrape' tool is defined in the TOOLS array with its schema, endpoint, and pricing.
    { name: 'scrape', description: 'Scrape and extract text content from a URL', inputSchema: { type: 'object', properties: { url: { type: 'string' } }, required: ['url'] }, endpoint: '/scrape', price: '$0.001' },
  • index.js:50-79 (handler)
    The callTool function serves as the generic handler that executes the tool logic by fetching the configured endpoint.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
  • index.js:94-115 (handler)
    The CallToolRequest handler routes the request to the callTool function based on the tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      
      if (!API_KEY) {
        return {
          content: [{ type: 'text', text: 'Error: ITERATOOLS_API_KEY environment variable not set. Get a key at https://iteratools.com' }],
          isError: true,
        };
      }
      
      const tool = TOOLS.find(t => t.name === name);
      if (!tool) {
        return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
      }
      
      try {
        const result = await callTool(tool.endpoint, args);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      } catch (err) {
        return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
      }
    });
Behavior3/5

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

No annotations provided, so description carries full burden. Includes pricing transparency ($0.001) but omits critical behavioral details: output format (plain text, markdown, JSON?), JavaScript rendering support, error handling for 404s/redirects, and whether the operation is idempotent/read-only.

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 sentence, front-loaded with specific verbs, zero redundancy. The cost parenthetical is appropriately placed and succinct.

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?

For a single-parameter tool, it covers the core operation and cost, but is incomplete due to missing output format specification (critical since no output schema exists) and absence of error behavior documentation.

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?

With 0% schema description coverage, the description partially compensates by referencing 'a URL' which maps to the `url` parameter. However, it lacks specifics on URL format requirements (absolute vs. relative, protocol restrictions, allowed domains) or examples.

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?

Clearly states the action (scrape/extract) and target (text content from URL), including cost. However, it does not explicitly differentiate from sibling `browser_act` which may also retrieve web content, or clarify if this handles non-HTML content differently than `pdf_extract`.

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?

Provides no guidance on when to use this tool versus alternatives like `browser_act`, `screenshot`, or `search`. Does not mention prerequisites, supported content types (HTML vs. PDF), or limitations like paywall handling.

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/fredpsantos33/itera-tools-mcp'

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