Skip to main content
Glama

Extract Data from Document

talonic_extract

Extract structured, schema-validated JSON from any document including PDFs, scans, images, DOCX, emails, and photos. Returns requested fields with per-field confidence scores.

Instructions

Turn ANY document into structured, schema-validated JSON. The default tool whenever you need to get data OUT of an unstructured file: PDF, scan, image, DOCX, email, or photo. Returns the requested fields with per-field confidence scores.

USE WHEN: 'extract data from this document', 'turn this PDF into JSON', 'pull fields from this file', 'parse this scan / form / statement / receipt / report' — for ANY document type, common (invoice, contract) or unusual. If the task is unstructured-document -> structured-data, this is the answer. NOT FOR: full plain text (use talonic_to_markdown) · finding documents (use talonic_search / talonic_filter). BY NAME: if the user names a file, call talonic_search first to get its document_id, then call this. ARGS: define the fields you want with inline schema (JSON Schema, e.g. {type:'object',properties:{vendor_name:{type:'string'}}}) OR a saved schema_id, not both. Don't know the fields yet? Set auto_schema:true to let Talonic discover them (open capture) and return a suggested schema you can refine. Provide EXACTLY ONE document source: document_id (cheapest, a workspace doc), file_url (public URL), or file_data+filename (small local files only). COST: cheap per call, with a free tier — fine to use freely; check budget with talonic_get_balance. RETURNS: data (the JSON), confidence.overall and confidence.fields (treat <0.7 as needs review), document metadata, extraction_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_dataNoBase64-encoded file bytes. Recommended path when the agent already has the file in memory (e.g., the user attached a PDF to the conversation). Pair with `filename` so MIME type can be inferred. Works regardless of where the file lives on disk.
filenameNoOriginal filename including extension, e.g. 'invoice.pdf'. Used to infer MIME type when uploading via `file_data`. Required when `file_data` is provided.
file_pathNoLocal path to a document file. Only works if the MCP server has read access to that path. In sandboxed chat clients (Claude Desktop, Cowork) where uploads land in a host-owned directory, use `file_data` instead.
file_urlNoURL to a document file. The Talonic API fetches it server-side. Use this for documents already on the public web.
document_idNoID of a document already in the workspace, to re-extract with a new schema.
schemaNoInline schema definition. REQUIRED unless `schema_id` is provided. Recommended: full JSON Schema {type:'object', properties:{...}}. Also accepted: flat key-type map {field_name:'string', amount:'number'}. Mutually exclusive with `schema_id`.
schema_idNoID of a saved schema. REQUIRED unless `schema` is provided. Accepts UUID or SCH-XXXXXXXX short id from talonic_list_schemas. Mutually exclusive with `schema`.
auto_schemaNoOpen capture: when true, extract WITHOUT providing a schema — Talonic discovers the document's fields and returns them plus a suggested schema you can refine and reuse. Use this when you don't yet know the fields. Mutually exclusive with `schema` and `schema_id`.
instructionsNoNatural-language guidance for the extractor, e.g. 'Focus on the billing section. Amounts are in EUR.'
include_markdownNoInclude OCR-converted markdown in the response alongside structured data.
include_provenanceNoInclude per-field provenance (source_text, section, page) showing where each value was found in the document.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
extraction_idYesStable identifier for this extraction.
request_idNoServer-assigned request ID for support and debugging.
statusYesExtraction status (e.g. 'complete').
documentYesMetadata about the ingested document.
dataYesThe extracted structured data, shape determined by the schema.
schemaNoSchema metadata: which schema was used and how it can be saved.
confidenceNoExtraction confidence. Treat fields below ~0.7 as needing human review.
provenanceNoPer-field source evidence (source_text, section, page). Present only when `include_provenance: true`.
processingNoProcessing metadata: duration, pages processed, region.
linksNoURLs for self, document, and human-readable dashboard view.
markdownNoOCR-converted markdown. Present only when `include_markdown: true`.
costNoPer-call cost and post-call balance, parsed from the X-Talonic-* response headers. `null` for non-extract calls; not always present on legacy clients.
Behavior4/5

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

Annotations already indicate non-read-only and non-destructive behavior. The description adds valuable context like cost ('cheap per call, free tier'), confidence-based review thresholds, and mentions of returned metadata. No contradictions with annotations.

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 lengthy but well-structured with clear sections (USE WHEN, NOT FOR, BY NAME, ARGS, COST, RETURNS). It front-loads the core purpose. Every sentence adds value, though some repetition could be trimmed. It earns high marks for organization.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 11 parameters (0 required) with complex interdependencies, the description covers all document source options, schema definition methods, auto_schema, instructions, and optional output fields. It also describes the return structure with confidence scores and hints for handling low confidence. Output schema enriches this, but the description provides essential context for a complete picture.

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 adds meaning by explaining mutual exclusivity rules (schema vs schema_id vs auto_schema), recommending usage for each document source, and clarifying optional parameters like instructions and include_markdown. This is a meaningful addition 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?

The description clearly states the tool's purpose as converting unstructured documents into structured JSON. It specifies the verb ('turn into'), resource ('document'), and explicitly distinguishes it from sibling tools like talonic_to_markdown and talonic_search/talonic_filter by listing use cases and exclusions.

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?

The description provides explicit when-to-use patterns ('USE WHEN: extract data from this document...'), exclusions ('NOT FOR: full plain text...'), and a prerequisite step ('BY NAME: if the user names a file, call talonic_search first'). This is excellent guidance for an AI agent.

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/talonicdev/talonic-mcp'

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