Skip to main content
Glama

Extend MCP

Extract structured data from a document

extract_data

Extract specific structured values (totals, line items, dates, names, tables) from a document (extract group) using a saved extractor, an inline JSON Schema, or schema-less inference. If the user says "OCR" but wants specific values out, use this tool; for the raw text/markdown of the pages use parse_document instead. Provide exactly one of extractor or config, or omit both for schema-less inference (guided by config.extractionRules when config has no schema; not usable with package). If a saved extractor turns out not to exist, rerun THIS tool without the extractor (schema-less) — do not fall back to parse_document for value extraction. For one merged result across 2-50 related documents, pass package instead of file. detail: "full" returns per-field source citations and confidence — the only way to prove where a value came from (provenance); parsing cannot cite. Async: a status: "running" result with a runId is not an error — resume with get_extract_run passing that runId, the same workspaceId and environment, and wait: true, repeating until the status is terminal; never re-submit the document. On UNAUTHORIZED or NOT_FOUND, re-call get_me for the granted targets. Output shape (output.value, per-field metadata, confidence, citations) is documented at https://docs.extend.ai/extraction/response-format.md (get_documentation).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoThe document to extract from. Mutually exclusive with package. Exactly one of id/url/text — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
configNoInline extraction config: { schema?, extractionRules?, baseProcessor?, advancedOptions?, parseConfig? }. Writing schema by hand? ALWAYS call get_documentation with https://docs.extend.ai/extraction/schema.md FIRST and follow the returned dialect — the rules below are only a summary (field-naming best practices: https://docs.extend.ai/extraction/best-practices/field-names-and-prompt-crafting.md). schema is a JSON Schema: root "type": "object"; primitives nullable via a type array (["string","null"]); objects/arrays keep a plain "type" (never a nullable array) and objects always need "properties"; max depth 5; enums include null; no anyOf/oneOf/allOf/patterns. Date/currency/signature fields add "extend:type" alongside a normal type. A currency field is exactly: { "type": "object", "extend:type": "currency", "properties": { "amount": { "type": ["number", "null"] }, "iso_4217_currency_code": { "type": ["string", "null"] } } } — never a bare number. Omit schema for schema-less mode (no docs needed): extractionRules then doubles as schema-generation instructions.
detailNo"concise" (default): status, output, failure fields, dashboardUrl. "full": adds config, confidence/citations, usage, timestamps.
packageNoMulti-document corpus (2-50 files, id/url only) extracted into one merged result. Mutually exclusive with file; not usable with schema-less mode.
metadataNoArbitrary key-value metadata stored on the run.
priorityNoQueue priority (1-100).
extractorNoSaved extractor to run. Mutually exclusive with config; omit both for schema-less inference.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
waitSecondsNoMax seconds to block waiting on the run (clamped to the server wait budget).
workspaceIdYesTarget workspace (ws_...). Must be a granted workspace — get_me lists the accepted values.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
filesNo
runIdYes
outputNoExtracted values (PROCESSED only).
statusYesTerminal status, or "running" (resume via the get tool).
runTypeNo
dashboardUrlNo
failureReasonNo
failureMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / properties / llmContext
      Removed value: -{
      -  "type": "string"
      -}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only set openWorldHint and a few flags, so the description carries the full burden of behavioral disclosure. It explicitly states that a status: 'running' result is not an error, dictates resuming via get_extract_run with wait: true, and warns never to re-submit the document. It also discloses that detail: 'full' provides provenance/citations, which parsing cannot offer, and points to external documentation for output shape.

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 description is long, but every sentence carries operational weight: mode selection, async behavior, error recovery, and documentations links. It is front-loaded with the core purpose and then layers conditions, though it is a dense continuous paragraph that could benefit from light structuring. Still, for a 10-parameter, multi-mode tool, the length is justified.

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?

Given high complexity, nested objects, async semantics, and multiple mutually exclusive modes, the description is remarkably complete. It covers what the tool does, when to use alternatives, how to handle async statuses, authentication errors, package constraints, schema dialect details, and even provenance semantics. The presence of an output schema and a documentation link further fills any remaining gap.

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

Parameters5/5

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

Schema coverage is 100%, which gives a baseline of 3, but the description adds substantial meaning beyond parameter names. It explains the exact JSON Schema dialect rules for config, gives the precise structure for currency fields, enforces mutual exclusivity of file/package/extractor, and links workspace/environment constraints to get_me. This is far more than the schema alone provides.

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 opens with a specific verb and resource: 'Extract specific structured values (totals, line items, dates, names, tables) from a document'. It also enumerates the three modes of operation (saved extractor, inline JSON Schema, or schema-less inference), making the tool's scope unmistakable. It distinguishes itself from parse_document by clarifying that raw page text belongs to parse_document, which is strong sibling differentiation.

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?

The description gives explicit when-to-use guidance: use extract_data when the user wants specific values, and parse_document for raw text/markdown. It also provides fallback behavior when a saved extractor does not exist, explains package vs. file selection for multi-document corpora, and gives precise async resume instructions with get_extract_run. Error handling for UNAUTHORIZED or NOT_FOUND is called out with a concrete next action (re-call get_me).

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.

Resources