Skip to main content
Glama
sawftware-apps

DocImprint Document Intelligence

Official

Extract Structured Data

document.extract_structured
Read-onlyIdempotent

Extract specific fields like dates, parties, or amounts from any document using a custom schema. Define the data points you need and get structured, cited results.

Instructions

Extract typed fields from document text using a caller-defined schema. Uses a quality AI model with retry logic. Use when you need specific data points from a document rather than full text. For invoices with known fields, document.parse_invoice (prebuilt schema) may be simpler. For general summarization, use document.summarize instead. Schema format: { "field_name": "type hint or description" } — e.g. { "contract_date": "ISO date", "party_a": "string", "penalty_usd": "number" }. Returns: { data: { : value }, data_cited: { : { value, confidence: "high"|"medium"|"low", citations: [{ quote, paragraphs[] }] } } } Example prompts:

  • "Extract the contract date, parties, and penalty amount from this agreement."

  • "Pull the vendor name, PO number, and total from this document."

  • "Get me all named fields from this form using my custom schema."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesDocument text to extract from. Obtain via document.extract_text or url.extract. Example: "This Service Agreement is entered into on 2025-03-15 between ACME Corp and Beta Inc..."
schemaYesField map: describe each field you want extracted with a type hint. Example: { "total_usd": "number", "vendor": "string", "invoice_date": "ISO date YYYY-MM-DD" }
max_tokensNoInput length cap (1 token ≈ 4 chars). Default ~2500 tokens. Truncates input, not output. Example: 3000

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
data_citedYes
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the description doesn't need to restate them. It adds useful context about using a 'quality AI model with retry logic' and details the return structure with confidence levels and citations, which goes beyond annotation coverage.

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?

The description is moderately long but well-structured, with clear sections for purpose, usage, schema format, output, and examples. Every section earns its place given the tool's complexity, though it could be tightened slightly without losing value.

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?

The description covers usage context, alternatives, parameter examples, and explicitly describes the return object. For a complex tool with an output schema, this is comprehensive enough for an agent to select and invoke it correctly, though it doesn't address potential errors or edge cases.

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 baseline is 3. The description provides a concrete schema format example and example prompts, but the schema descriptions already explain the parameters well. The added value is marginal—mainly illustrative rather than clarifying new semantics.

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?

The description clearly states the tool extracts typed fields from document text using a caller-defined schema. It distinguishes itself from sibling tools by mentioning schema-driven extraction and explicitly contrasts with document.parse_invoice and document.summarize.

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?

Explicit guidance is provided: 'Use when you need specific data points from a document rather than full text,' and alternatives are named: 'For invoices with known fields, document.parse_invoice may be simpler. For general summarization, use document.summarize instead.'

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sawftware-apps/docimprint-sdk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server