Skip to main content
Glama

Olaverse Lab

extract_document

Turn a document into JSON shaped like template, with a calibrated confidence (0-1) for every field.

template: the shape of the answer; each leaf names a type: "verbatim-string" (copied exactly), "string",
  "number", "integer", "date" (YYYY-MM-DD), "date-time", "boolean", ["a", "b"] (pick one), [["a", "b"]] (pick
  any), ["string"] (a list), or [{...}] (a list of objects, e.g. line items).
  Example: {"merchant": "verbatim-string", "total": "number", "date": "date",
            "items": [{"name": "verbatim-string", "price": "number"}]}
Give the document as exactly one of:
  text: the document as text.
  image: a JPEG or PNG, base64 or a data URL (a photo, scan or screenshot of one page).
  pdf: a PDF with a text layer, base64.
  file_path: a JPEG/PNG, PDF or text file on this machine (local server only).
instructions: optional guidance, e.g. "dates are day/month/year" or "amounts in kobo".

Long documents (over 60,000 characters) are split into parts, extracted in parallel and merged; that can take
minutes. Missing values come back as null. Treat fields with confidence below about 0.95 as needing a check.

Input Schema

NameRequiredDescriptionDefault
pdfNo
textNo
imageNo
templateYes
file_pathNo
instructionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With zero annotations the description carries the full burden and does substantial work: it discloses the >60,000-character chunking and parallel-merge behavior, warns the call can take minutes, states missing values return null, and interprets the confidence scale ('below about 0.95 as needing a check'). What it omits is whether the long-document path returns synchronously or hands back a job id, which matters given the polling sibling.

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 core action and output contract are front-loaded in the first sentence, and the remaining blocks are scoped to one concern each (template grammar, input modalities, instructions, long-document caveat). The template grammar block is long but each entry encodes a distinct type the agent cannot infer, so it earns its space.

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

Completeness4/5

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

There is no output schema, and the description correctly fills that gap by defining the return shape, the null convention, and the confidence interpretation. For a six-parameter tool with nested template objects, the only real hole is the async/job relationship for oversized inputs.

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 description coverage is 0%, so the description must compensate entirely, and it does: every leaf type of `template` is enumerated with semantics ('verbatim-string' copied exactly, 'date' as YYYY-MM-DD, ['a','b'] pick one vs [['a','b']] pick any) and an example object is given. Each of `text`, `image`, `pdf`, and `file_path` gets a format and scope note, including the 'local server only' restriction on file_path.

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 opening line gives a specific verb and resource — 'Turn a document into JSON shaped like `template`' — plus the distinctive output property (a calibrated 0-1 confidence per field). That is enough to separate it from siblings like `get_extraction_job` or `generate_questions` without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly states the accepted input modalities ('exactly one of: text, image, pdf, file_path') and gives concrete examples of when to supply `instructions` ('dates are day/month/year'). It does not explicitly route the agent to or away from alternatives — notably `get_extraction_job` for the long-document case it warns about — so the when-to-use picture is clear but incomplete.

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.