Skip to main content
Glama

Extract document fields (batch)

doc_extract_batch
Read-onlyIdempotent

Extract structured fields from 1 to 5 Arabic documents in one paid call: $0.10 for the batch, i.e. $0.02 per document instead of $0.03. Documents are processed independently and in parallel, results come back in request order with an echoed id, and one unreadable image does not fail the rest (it appears with ok=false and an error). Use this for a stack of receipts, invoices or bank slips.

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": {
      "documents": "<documents>"
    },
    "name": "doc_extract_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
documentsYes1 to 5 documents, extracted independently and in parallel.
mime_typeNoDefault MIME type for documents that omit their own.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds high-value behavior the annotations cannot convey: exact pricing ($0.10 batch vs $0.02/doc), parallel independent processing, request-order results, and partial-failure semantics (ok=false with an error, other items still succeed).

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?

A single dense sentence front-loads the core action and cost, then layers ordering and failure behavior, then closes with the use case. No filler or repetition of schema facts.

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?

With no output schema, the description does explain return ordering, echoed ids, and the per-item error shape, which is the critical part. It never says which structured fields are extracted or what a successful item contains, leaving a modest gap for a tool with no output schema.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns extra by explaining runtime semantics of the inputs — per-item independence, echoed id, and that the 1–5 limit is a hard cap. It doesn't add anything about the top-level mime_type default, hence not a 5.

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?

States a specific verb and resource plus the batch dimension: 'Extract structured fields from 1 to 5 Arabic documents in one paid call.' This clearly separates it from the sibling doc_extract (single-document) and from text_* utilities.

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 a concrete usage context ('Use this for a stack of receipts, invoices or bank slips') and the 1–5 batching constraint, which implies the single-document alternative. It does not explicitly name doc_extract or state when to prefer it, so it stops short of full routing guidance.

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.