Skip to main content
Glama

Brainiall Documents

Extract Document Fields

extract_document_fields
Read-onlyIdempotent

Extract structured fields and full text from a document image.

Use this for invoices, receipts, forms, and similar PNG or JPEG images when the agent needs named fields rather than Markdown. PDF input is intentionally rejected; use pdf_to_markdown for PDFs.

Returns: A dictionary containing request metadata, extracted fields, and text, or an actionable error object on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic URL pointing directly to a PNG or JPEG document image. Provide this or image_base64, never both.
doc_typeNoDocument type that guides field extraction, such as 'invoice' (default), 'receipt', or 'form'.invoice
image_base64NoBase64-encoded PNG or JPEG bytes. Provide this or url, never both.

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds genuinely useful behavioral context: PDF input is rejected, the output is a dictionary with request metadata/fields/text, and failures return an actionable error object. This goes beyond what annotations alone provide.

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: purpose first, usage guidance second, output behavior last. Every sentence earns its place, and no information is repeated from the schema unnecessarily.

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 three-parameter image extraction tool with high schema coverage and clear sibling routing, the description is nearly complete. The only minor gap is the lack of auth/rate-limit context, but the annotations and return-shape summary cover the essential operational guidance.

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 explains url, doc_type, and image_base64. The description reinforces relevant use cases like invoices, receipts, and forms, but it does not add substantial new parameter-level meaning beyond the schema.

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: 'Extract structured fields and full text from a document image.' It also distinguishes itself from pdf_to_markdown by emphasizing 'named fields rather than Markdown,' making the tool's role clear relative to its siblings.

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

Usage Guidelines5/5

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

Explicitly says when to use it: for invoices, receipts, forms, and PNG/JPEG images when named fields are needed. It also gives a clear exclusion: PDF input is intentionally rejected and pdf_to_markdown should be used instead. This is strong alternative routing.

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

A4.3/5.0
Disambiguation5/5

Each tool targets a distinct operation: service health checking, image-based field extraction, and PDF-to-Markdown conversion. The descriptions explicitly separate image vs PDF input and structured fields vs Markdown output, so there is no meaningful overlap.

Naming Consistency4/5

check_document_service and extract_document_fields follow a clear verb_noun pattern, while pdf_to_markdown uses a conventional format-conversion style. The consistent snake_case naming and domain-specific verbs keep the set predictable despite the one stylistic deviation.

Tool Count5/5

Three tools is well-scoped for a focused document conversion and extraction service. Each tool earns its place, and the included health check supports workflow reliability without adding unnecessary bloat.

Completeness4/5

The core document workflows are covered: PDFs become Markdown, document images become structured fields and text, and availability is checkable. Direct PDF-to-fields and image-to-Markdown paths are missing, but agents can work around these using the text and Markdown outputs, making these minor gaps rather than fatal omissions.

Resources