Skip to main content
Glama

Document Extraction

documents
Read-only

Extract structured data from URLs or content. Returns the extracted data as JSON (shaped by your schema when you pass one), with the source URL and whether long content was truncated. Use to turn a page or a text into structured fields. For a page's full text use scrape; for invoices and receipts use invoice-parse. Pass url or content; extraction_prompt says what to extract, and schema fixes the shape of the JSON you get back. Cost: 3 credits, charged only when a call succeeds.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "extraction_prompt": "<extraction_prompt>"
    },
    "name": "documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoURL to scrape and extract from.
schemaNoJSON schema for extraction.
contentNoPre-scraped text content.
extraction_promptYesWhat to extract (required unless schema is provided).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly, openWorld, and non-destructive behavior. The description adds important operational context beyond annotations: the JSON return payload includes source URL and truncation status, and the call costs 3 credits charged only on success. This meaningfully informs invocation decisions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, followed by return behavior, alternatives, parameter notes, and cost. There is some redundancy, especially between 'Extract structured data' and 'Use to turn a page or a text into structured fields,' and the schema-shaping idea is repeated, but the description remains efficient.

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?

No output schema exists, so the description carries the burden of explaining return values, which it does by specifying the JSON payload, source URL, and truncation flag. It also covers the main selection decision and the credit model, making it complete enough for a nested-schema extraction tool.

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 description coverage is 100%, so all four parameters are already documented in the schema. The description adds only that the caller should pass url or content and links extraction_prompt to what is extracted and schema to output shape; most of that is already in the schema descriptions.

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 a specific verb and resource: 'Extract structured data from URLs or content.' It distinguishes the tool from sibling alternatives by naming scrape for full page text and invoice-parse for invoices and receipts.

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?

It gives explicit when-to-use guidance: turn a page or text into structured fields. It also names concrete alternatives and the conditions that select them, so there is no ambiguity about when to use this tool instead of scrape or invoice-parse.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.