Skip to main content
Glama

Extract Document Fields

document_extract
Read-onlyIdempotent

Turn a document image into structured fields. doc_type picks the schema (receipt/invoice/id/contract/form/generic).

A page with no readable text returns an error rather than a guess.

Returns: dict with keys: doc_type (str), fields (dict — null for any value not present), text (str — the recognised plain text).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYesBase64-encoded PNG/JPEG of a single document page
doc_typeNoThe document kind — picks the field schema: receipt | invoice | id | contract | form | generic | business_card | w2 | health_card | mortgage | pay_stubgeneric

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already mark the tool as readOnly, idempotent, and non-destructive. The description adds meaningful behavior beyond this: blank pages return an error rather than a guess, and the return structure is disclosed with fields null when absent. This is solid transparency, though it omits details like rate limits or authentication requirements.

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?

The description is compact and front-loaded with the core purpose, followed by a key error behavior and a clear return structure. Every sentence earns its place, and there is no filler.

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?

Since there is no output schema, the description correctly and sufficiently documents the return keys and null behavior. It also covers the main error case. It is nearly complete for a low-complexity read-only tool, though it could better route agents away from sibling document tools.

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 description coverage is 100%, so the schema already documents both parameters. The description adds that doc_type selects the field schema, which clarifies its role. However, the description lists only six doc_type options while the schema lists additional valid types such as business_card, w2, and pay_stub, which could mislead an agent relying solely on the description.

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 clearly states the tool's function: turning a document image into structured fields, with doc_type selecting the schema. It is specific about the resource and output, though it does not explicitly differentiate it from sibling tools like document_to_markdown or document_tables.

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?

The description implies when the tool should be used: when structured field extraction from a document image is needed. It also gives a useful error condition for unreadable pages. However, it does not explicitly state when to prefer this over document_query, document_tables, or document_to_markdown, nor provide exclusions.

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.

TDQS

A3.7/5.0
Disambiguation4/5

Most tools are clearly distinct: document_* handle document analysis, while image tools (remove_background, restore_face, upscale_image) are unambiguous. However, document_extract and understand_content both perform field extraction from documents, differing mainly in schema flexibility, which could cause misselection. run_skillsets also overlaps conceptually as a pipeline tool.

Naming Consistency3/5

Naming is partially consistent: image tools follow a verb_noun pattern (remove_background, restore_face, upscale_image), and document tools share a 'document_' prefix. However, the document tools mix noun_verb (document_extract, document_query) with noun_noun (document_tables) and document_to_markdown deviates with a preposition. This mixed convention reduces predictability.

Tool Count5/5

With 10 tools, the count is well within the ideal 3-15 range. Each tool addresses a meaningful capability, from document parsing to image enhancement, without feeling redundant or excessive. The scope is appropriate for a multi-purpose image/document API.

Completeness4/5

The surface covers core workflows: document structuring (extract, markdown, tables, query), image enhancement (upscale, background removal, face restore), and health checks. Minor gaps include lack of explicit image format conversion or document deletion, but these are not essential for the stated purpose. Overall, the tools form a coherent set with no obvious dead ends.

Resources