Skip to main content
Glama

Document-to-JSON Converter

Turn PDFs into structured JSON in seconds. AI-powered, no coding needed.

MCP Server License: MIT Apify


๐Ÿš€ What does it do?

Paste a PDF URL โ†’ get structured JSON. That's it.

Powered by AI. Instead of rigid templates or fragile regex, an AI model actually reads and understands each document โ€” so it adapts to any layout, language, or vendor, and even handles scanned files. That's why the same tool works on an Italian invoice, a Spanish receipt, or an English contract without any configuration.

Perfect for:

  • Accountants โ€” extract invoice data (numbers, dates, totals, VAT, IBAN)

  • Developers โ€” automate document processing in your apps

  • Business analysts โ€” convert bank statements to spreadsheets

  • Legal teams โ€” extract contract clauses and dates automatically

Related MCP server: Invoice Parser MCP

๐Ÿ“‹ Supported documents

Type

What you get

Price

Invoice

Seller, buyer, line items, totals, VAT, IBAN, payment info

$0.01

Bank Statement

All transactions, balances, fees, account holder

$0.015

Contract

Parties, key clauses, dates, financial terms, jurisdiction

$0.02

Generic

Full text + tables from any document

Free during launch

โœจ Example output

{
  "success": true,
  "data": {
    "document_type": "invoice",
    "confidence": 0.97,
    "metadata": {
      "invoice_number": "INV-2024-00123",
      "invoice_date": "2024-03-15",
      "currency": "EUR"
    },
    "seller": {
      "name": "Acme S.p.A.",
      "vat_id": "IT01234567890"
    },
    "line_items": [
      {
        "description": "Consulting services",
        "quantity": 1,
        "unit_price": 5000.00,
        "net_amount": 5000.00,
        "vat_rate": 22.0,
        "total": 6100.00
      }
    ],
    "totals": {
      "net_total": 5000.00,
      "vat_total": 1100.00,
      "grand_total": 6100.00
    },
    "payment_info": {
      "iban": "IT60X0542811101000000123456"
    }
  }
}

๐Ÿงช Live examples โ€” try them now

Run the Actor on these public sample PDFs (synthetic data) to see the extraction quality for yourself:

Type

Sample PDF

What the AI extracts (highlights)

Invoice

sample-invoice.pdf

Invoice INV-2026-0042, seller + buyer with VAT IDs, 2 line items, VAT 22%, grand total โ‚ฌ1,889.78 โ€” confidence 1.0

Bank statement

sample-bank-statement.pdf

7 transactions auto-categorized, opening/closing balances reconciled to โ‚ฌ8,655.28 โ€” confidence 1.0

Contract

sample-contract.pdf

2 parties + roles, effective/expiry/renewal dates, fee โ‚ฌ5,000, 5 key clauses with summaries, jurisdiction โ€” confidence 0.95

Just paste one of these URLs as file_url, pick the matching document_type, and run. Each extraction takes ~15โ€“20 seconds.

๐ŸŽฏ Why this Actor?

Feature

Benefit

AI understanding

An AI reads documents like a human โ€” adapts to any layout, no templates or rules to maintain

Multi-language

English, Italian, Spanish (OCR)

OCR included

Works with scanned documents too

Validation

Auto-checks totals and dates for accuracy

Pay per use

No subscription, pay only for what you process

๐Ÿ”ง How to use

  1. Get a public PDF URL (Dropbox, Google Drive, your server)

  2. Select the document type

  3. Run the Actor

  4. Get your JSON in seconds

That's it. No configuration, no API keys needed.

๐Ÿ’ฐ Pricing

Document type

Price

Invoice

$0.01 ($10/1000)

Bank statement

$0.015 ($15/1000)

Contract

$0.02 ($20/1000)

Generic

Free during launch

Pay-per-event via Apify. Pay only for successful extractions. No subscription, no hidden fees.

๐Ÿ”’ Privacy

  • PDFs are processed and not stored after extraction

  • Data is available in your private dataset

  • All API keys stay encrypted

๐Ÿ“š Supported OCR languages

eng (English), ita (Italian), spa (Spanish)

Combine with + for multi-language scanned documents: eng+ita+spa (default)

๐Ÿค– Built for AI agents (MCP)

This Actor is an MCP server: AI agents can call it directly as a tool to turn any PDF into JSON, with zero configuration โ€” just pass a public file_url. Specialized tools (parse_invoice, parse_bank_statement, parse_contract) and a free parse_generic_document make it easy for an LLM to pick the right one for the task.

๐Ÿ”Œ Integrations

Replace YOUR_APIFY_TOKEN with your token from Apify โ†’ Settings โ†’ Integrations.

Claude Code (CLI)

claude mcp add --transport http apify \
  "https://mcp.apify.com/?actors=opportunity-biz/document-to-json-mcp"

Claude Desktop / Cursor (MCP)

Add to your MCP config (claude_desktop_config.json or Cursor's mcp.json):

{
  "mcpServers": {
    "document-to-json": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://mcp.apify.com/?actors=opportunity-biz/document-to-json-mcp",
        "--header", "Authorization: Bearer YOUR_APIFY_TOKEN"
      ]
    }
  }
}

The agent then sees parse_invoice, parse_bank_statement, parse_contract, and parse_generic_document as tools and calls them on its own.

REST API (any language)

One call in, JSON out โ€” run-sync-get-dataset-items returns the result directly:

curl -X POST \
  "https://api.apify.com/v2/acts/opportunity-biz~document-to-json-mcp/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_url": "https://example.com/invoice.pdf", "document_type": "invoice", "validate_totals": true}'

Python

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("opportunity-biz/document-to-json-mcp").call(run_input={
    "file_url": "https://example.com/invoice.pdf",
    "document_type": "invoice",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

JavaScript / TypeScript

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('opportunity-biz/document-to-json-mcp').call({
  file_url: 'https://example.com/invoice.pdf',
  document_type: 'invoice',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

n8n

Use an HTTP Request node (POST) to the REST API URL above, or the official Apify node โ†’ select document-to-json-mcp โ†’ set file_url and document_type. Great for "watch inbox โ†’ extract invoice โ†’ append to Google Sheet" workflows.

LangChain / CrewAI / any MCP framework

Point your agent framework's MCP client at https://mcp.apify.com/?actors=opportunity-biz/document-to-json-mcp โ€” the parsing tools are exposed automatically.

Available Tools

5 tools
parse_bank_statementAInspect
Extract structured data from a bank statement PDF.

Returns JSON with all transactions, balances, account holder info, and fees.

Args:
    file_url: Public URL of the PDF file (max 20MB).
    language: Document language(s) for OCR. Default: ita+eng.
    categorize_transactions: Auto-categorize transactions. Default: false.

Cost: $0.03 per document, paid via x402 USDC on Base.
ParametersJSON Schema
NameRequiredDescriptionDefault
file_urlYes
languageNoita+eng
categorize_transactionsNo

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It discloses cost ($0.03 per document via x402 USDC on Base), file size limit (20MB), default language (ita+eng), and auto-categorization option. It does not detail error behavior or idempotency, but these are less critical for a read-only parse tool.

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 concise, starting with the purpose, then return type, followed by a bullet list of arguments with defaults. Every sentence adds value, no redundancy.

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?

Given three parameters, no output schema, and no annotations, the description covers purpose, return structure, constraints (file size, cost, defaults). It lacks error handling or format details but is sufficient for a straightforward parse tool.

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 description coverage is 0%, so description compensates well. For file_url it adds max file size; for language it explains OCR usage and default; for categorize_transactions it explains auto-categorization and default. This adds meaningful context beyond schema titles and types.

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 it extracts structured data from a bank statement PDF, listing specific return fields (transactions, balances, account holder info, fees). It distinguishes from sibling tools like parse_contract, parse_generic_document, parse_invoice, and supported_document_types by focusing solely on bank statements.

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 usage for bank statement PDFs but does not explicitly state when to use this tool versus alternatives (e.g., parse_invoice for invoices). No 'when not to use' or explicit context is provided, though sibling names help differentiate.

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

parse_contractAInspect
Extract structured data from a contract PDF.

Returns JSON with parties, key dates, financial terms, and essential clauses.

Args:
    file_url: Public URL of the PDF file (max 20MB).
    language: Document language(s) for OCR. Default: ita+eng.
    extract_clauses: Extract key clauses (termination, confidentiality, etc.). Default: true.
    extract_financial_terms: Extract fees, payment terms, penalties. Default: true.

Cost: $0.05 per document, paid via x402 USDC on Base.
ParametersJSON Schema
NameRequiredDescriptionDefault
file_urlYes
languageNoita+eng
extract_clausesNo
extract_financial_termsNo

TDQS

A4.5/5.0
Behavior4/5

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

Despite no annotations, the description discloses important behavioral traits: cost ($0.05 via x402 USDC on Base), file size limit (max 20MB), and default languages. It does not cover failure modes or auth needs, but provides good context.

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 well-structured with clear 'Args' section, each sentence adds value. It is concise yet complete, with no redundant information.

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?

Given no output schema and no annotations, the description covers purpose, parameters, cost, and output structure (JSON with specific fields). Lacks error handling details but is adequate for a 4-param tool.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by adding meaning to each parameter: file_url (public URL, max 20MB), language (default ita+eng), extract_clauses and extract_financial_terms (defaults and what they extract).

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 action ('Extract structured data') and target ('contract PDF'), differentiating it from siblings like parse_invoice or parse_bank_statement by specifying contract-specific extraction fields.

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?

The description implicitly guides use by listing extracted content (parties, dates, financial terms, clauses), making it clear for contracts. However, it lacks explicit 'when to use' or 'alternatives' guidance, leaving room for improvement.

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

parse_generic_documentAInspect
Extract text and tables from any PDF document.

Less structured than specialized parsers, but more flexible.
Returns full text content and detected tables.

Args:
    file_url: Public URL of the PDF file (max 20MB).
    language: Document language(s) for OCR. Default: ita+eng.
    extract_tables: Detect and extract tables. Default: true.

Cost: $0.01 per document, paid via x402 USDC on Base.
ParametersJSON Schema
NameRequiredDescriptionDefault
file_urlYes
languageNoita+eng
extract_tablesNo

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries full burden. It discloses cost ($0.01 per doc via USDC), file size limit (20MB), default language (ita+eng), and that it extracts text and tables. No contradictions.

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?

Three sentences plus an arg list, front-loaded with purpose, every sentence adds value. No redundant information.

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 no annotations, no output schema, and 0% schema coverage, the description covers purpose, usage, parameters, cost, and limits. Returns description is sufficient.

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

Parameters5/5

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

Schema description coverage is 0%, but the description adds meaning for all three parameters: file_url (public URL, max 20MB), language (OCR languages, default ita+eng), extract_tables (boolean, default true).

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 it extracts text and tables from PDF documents. It positions itself as less structured than specialized parsers (siblings) but more flexible, providing clear differentiation.

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?

It explicitly says when to use this tool (generic PDFs, when flexibility is needed) versus specialized parsers. It also mentions the cost, aiding decision-making.

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

parse_invoiceAInspect
Extract structured data from an invoice PDF.

Returns JSON with seller, buyer, line items, totals, and payment info.
Supports European (Fattura Elettronica) and international invoice formats.

Args:
    file_url: Public URL of the PDF file (max 20MB).
    language: Document language(s) for OCR. Default: ita+eng.
    extract_line_items: Whether to extract individual line items. Default: true.
    validate_totals: Validate that line item sums match declared totals. Default: false.

Cost: $0.02 per document, paid via x402 USDC on Base.
ParametersJSON Schema
NameRequiredDescriptionDefault
file_urlYes
languageNoita+eng
extract_line_itemsNo
validate_totalsNo

TDQS

A3.9/5.0
Behavior3/5

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

No annotations provided, so description carries full burden. Documents cost ($0.02 per document, x402 USDC on Base) and file size limit (20MB). Missing rate limits, idempotency, error behavior, 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and returns, followed by supported formats and parameter list. Efficiently written, but cost info placed at end and could be integrated earlier.

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

Completeness3/5

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

Covers input requirements, parameters, cost, and supported formats. Lacks output schema description, error handling, timeout, and authentication details. Adequate but missing operational context given no output schema and expected complexity.

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

Parameters5/5

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

Adds meaning to all 4 parameters with details not in schema: file_url (public URL, max 20MB), language (document language, default ita+eng), extract_line_items (boolean, default true), validate_totals (boolean, default false). Fully compensates for 0% schema description coverage.

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?

Clearly states 'Extract structured data from an invoice PDF' and specifies return fields (seller, buyer, line items, totals, payment info). Mentions support for European and international formats, differentiating from sibling tools like parse_bank_statement.

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?

Implies usage for invoices via tool name and supported formats, but provides no explicit guidance on when to use or when not to use, nor mentions alternatives like parse_generic_document.

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

supported_document_typesAInspect

List all supported document types with their descriptions and prices. This tool is always free to call.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

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

Given no annotations, the description correctly identifies the tool as free (no cost). For a read-only listing with zero side effects, this is sufficient transparency.

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?

Two concise sentences with no wasted words. The first sentence states the purpose, the second adds a key behavioral note.

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 simple listing tool with no parameters and no output schema, the description covers the essentials: what it does and that it's free. It could mention the return format, but the context is sufficient.

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?

There are no parameters, so the description does not need to add parameter information. The baseline for zero parameters is 4, and the description is adequate.

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 'List all supported document types with their descriptions and prices', which is a specific verb+resource combination. It differentiates from sibling parse tools by being a listing instead of parsing.

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?

It explicitly notes the tool is 'always free to call', implying no usage restrictions. While it doesn't explicitly state when to use vs. alternatives, the context of sibling parse tools suggests this is for discovery before parsing.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updates
    • First observedparse_bank_statement
    • First observedparse_contract
    • First observedparse_generic_document
    • First observedparse_invoice
    • First observedsupported_document_types

TDQS

A4.4/5.0
Disambiguation5/5

Each tool targets a distinct document type (bank statement, contract, generic, invoice) plus a listing tool, with no overlap in purpose.

Naming Consistency4/5

All parse tools follow a consistent 'parse_X' pattern, but the listing tool 'supported_document_types' deviates slightly; still clear and predictable.

Tool Count5/5

Five tools are well-scoped for a document parsing server, covering specific types and generic fallback without being excessive or thin.

Completeness5/5

The server provides specialized parsers for common documents, a generic parser for others, and a listing tool, covering the full parsing lifecycle.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to extract structured JSON from invoices and receipts in PDF and image formats using Claude Vision. Supports full document parsing, line item extraction, validation, and batch CSV export with API key or cryptocurrency payment options.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for StructDoc that converts documents (PDFs, images) into structured data like Markdown, OCR text, and invoice/receipt fields for AI agents, with pay-per-call via x402 (USDC on Base/Solana).
    10
    MIT

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/fashionmascherine-svg/document-to-json-mcp'

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