Document Tools
Extract the PDF text layer with geometry (lines by y-position, tables by column gaps, headings by font size, colon key-value pairs), then fill a user-supplied JSON Schema field by field — labels matched by normalized keys, values coerced to declared types and validated with ajv.
Call this tool from your code in three languages.
# 1) Request a presigned URL → returns { uploadUrl, storageKey }
curl -X POST 'https://api.elysiatools.com/api/upload/presign/ocr-pdf-to-structured-json-bridge' \
-H 'Content-Type: application/json' \
-d '{"filename":"pdfFile.ext","contentType":"application/octet-stream","size":12345}'
# 2) PUT the file bytes directly to the presigned uploadUrl
curl -X PUT '<presigned uploadUrl>' \
--data-binary @/path/to/file.ext
# 3) Call the tool, passing the returned storageKey for each file field
curl -X POST 'https://api.elysiatools.com/en/api/tools/ocr-pdf-to-structured-json-bridge' \
-F 'pdfFile=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'schemaInput={
"type": "object",
"properties": {
"invoice_number": { "type": "string" },
"invoice_date": { "type": "string", "format": "date" },
"customer": { "type": "string" },
"currency": { "type": "string", "enum": ["USD", "EUR"] },
"total": { "type": "number" }
},
"required": ["invoice_number", "total"]
}' \
-F 'numberStyle=auto'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/ocr-pdf-to-structured-json-bridge| Name | Type | Required | Description |
|---|---|---|---|
| pdfFile | fileupload required | Yes | — |
| schemaInput | textarea | Yes | — |
| numberStyle | select | Yes | — |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-ocr-pdf-to-structured-json-bridge": {
"name": "ocr-pdf-to-structured-json-bridge",
"description": "Extract the PDF text layer with geometry (lines by y-position, tables by column gaps, headings by font size, colon key-value pairs), then fill a user-supplied JSON Schema field by field — labels matched by normalized keys, values coerced to declared types and validated with ajv.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=ocr-pdf-to-structured-json-bridge",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "ocr-pdf-to-structured-json-bridge",
"arguments": {
"pdfFile": "https://example.com/file.ext",
"schemaInput": "{\n \"type\": \"object\",\n \"properties\": {\n \"invoice_number\": { \"type\": \"string\" },\n \"invoice_date\": { \"type\": \"string\", \"format\": \"date\" },\n \"customer\": { \"type\": \"string\" },\n \"currency\": { \"type\": \"string\", \"enum\": [\"USD\", \"EUR\"] },\n \"total\": { \"type\": \"number\" }\n },\n \"required\": [\"invoice_number\", \"total\"]\n}",
"numberStyle": "auto"
}
}
}Questions or issues? Contact [email protected]