Skip to main content
Glama
Olaverse MCP Server

Olaverse MCP Server

Official

extract_document

Converts text, images, or PDFs into template-shaped JSON with per-field confidence scores, helping agents verify extracted values.

Instructions

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 120,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.

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": {
      "template": "<template>"
    },
    "name": "extract_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
pdfNo
textNo
imageNo
templateYes
file_pathNo
instructionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does a lot of it: it discloses that documents over 120,000 characters are split, extracted in parallel and merged, that this can take minutes, and that missing values return as null. It stops short of saying whether a long run is synchronous or whether the caller must poll get_extraction_job, which is the main behavioral unknown left for a multi-minute operation.

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?

Front-loads the purpose, then answers the two questions a caller actually has: what shape do I send, and how do I read the result. The template DSL block is dense but every type listed is load-bearing; the paragraph on part-splitting and the 0.95 confidence threshold also earn their place. Minor looseness in the line-broken template type listing, but nothing extraneous.

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, so the description correctly explains the return value itself: JSON matching `template`, a confidence per field, null for missing values. For a tool of this complexity (nested template object, four input modalities, parallel merging on large inputs) the only meaningful omission is retrieval/polling semantics for long jobs.

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 define all six parameters, and it does: `template` gets a full leaf-type DSL with a worked example covering verbatim-string, number, date, enumerations, lists and nested line-item objects; the four input channels get format constraints (JPEG/PNG base64 or data URL, PDF with a text layer, local server only for file_path); and `instructions` gets usage examples. This is meaning the schema cannot convey.

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?

Opens with a specific verb and resource: turn a document into JSON shaped like `template`, with a per-field confidence. That output contract immediately separates it from siblings like detect_language, restore_diacritics or generate_questions, which do not produce a caller-defined structured object.

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?

Gives concrete operating context: supply the document as exactly one of text/image/pdf/file_path, use `instructions` for things like day/month/year dates or kobo amounts, and treat sub-0.95 confidences as needing a check. It does not explicitly say when *not* to reach for this tool versus get_extraction_job, so the routing for long-running work is implied rather than stated.

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