Skip to main content
Glama

Extract document

extract_document

Extract structured fields from an image (vision) or text against a declared schema. Provide fields and one of image_url or text. Stores the result for review; returns the extracted JSON.

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

Input Schema

NameRequiredDescriptionDefault
textNoRaw text to extract from (alternative to image_url).
fieldsYesFields to extract: [{name, description?, type?}].
image_urlNoPublic URL of an image/scan to read (vision).
source_refNo
instructionsNoOptional extra guidance.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare this is not read-only but not destructive, and the description explains why: the result is stored for review, and the extracted JSON is returned. That adds real value beyond the structured hints, including that vision is used for images. It does not mention that repeated calls will accumulate multiple stored results despite idempotentHint=false, which would have been a useful addition.

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?

Two tight sentences: the capability and both modalities come first, the required inputs and the one-of constraint follow. Nothing is redundant or padded.

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?

For a five-parameter extraction tool with no output schema, the description covers the core invocation contract and the return value, and annotations carry the safety profile. The remaining gap is `source_ref`, whose purpose is undisclosed in both schema and description, plus no note on size or URL accessibility limits for `image_url`.

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 coverage is 80%, so the baseline is 3. The one genuinely added piece of meaning is the mutual-exclusivity constraint ('one of `image_url` or `text`'), which the flat schema does not express. Beyond that it mostly restates required inputs, and `source_ref` remains undescribed in both places.

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?

The description names a concrete verb (extract), the resource produced (structured fields), and both supported sources (image via vision, text) against a declared schema. That is enough to separate it from the CRUD-style siblings such as create_document or update_document, though it does not explicitly say how it relates to them.

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

Usage Guidelines3/5

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

It gives a concrete invocation rule — supply `fields` plus exactly one of `image_url` or `text` — which implies the usage context. There is no explicit when-not guidance or named alternative, so an agent must infer the boundary cases itself.

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