Skip to main content
Glama

extract_document

Extract text from PDFs and images as structured Markdown. Handles complex layouts, tables, handwriting, and math notation. Pay per page with Bitcoin Lightning.

Instructions

Extract text from PDFs and images as clean Markdown. Uses Mistral OCR — handles complex layouts, tables, handwriting, multi-column documents, and mathematical notation. Preserves document hierarchy in structured Markdown. 10 sats/page. Pay per request with Bitcoin Lightning — no API key or signup needed. Requires create_payment with toolName='extract_document' and quantity=pageCount for multi-page PDFs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paymentIdYesValid payment ID (must be paid)
documentBase64YesBase64 encoded PDF or image
modelIdNoOptional. Omit for default model.
Behavior4/5

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

Without annotations, the description covers the OCR engine (Mistral), handling of complex layouts, cost (10 sats/page), and the payment flow. It does not mention limitations like file size, but the core behavior is well-disclosed.

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?

Four sentences, each adding essential information. Front-loaded with the main action, then details. No filler or 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?

The description covers the output (Markdown), payment flow, and OCR capabilities. It lacks mention of error handling or file size limits, but given schema coverage and no output schema, it is reasonably complete.

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?

All parameters have schema descriptions, but the description adds value by clarifying the payment prerequisite, explaining that paymentId must be paid, and noting modelId is optional. This goes 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 it extracts text from PDFs and images as clean Markdown. It specifies the verb 'extract', the resource 'PDFs and images', and the output format, making the purpose unmistakable.

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 explains the prerequisite of creating a payment via create_payment with specific parameters, and notes that no API key is needed. It doesn't explicitly list when not to use it, but provides clear context for using it correctly.

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/cnghockey/sats4ai-mcp-server'

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