Skip to main content
Glama

Extract Data from Image or PDF

extract_data

Extract structured data from an image using a predefined layout. Uses AI cascade strategy for optimal cost-accuracy balance.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>",
      "image_url": "<image_url>"
    },
    "name": "extract_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
image_urlYesURL of the image to process (HTTPS URL)
project_idYesUUID of the project (required)
extraction_modeNoExtraction mode: 'ocr' for text recognition (default), 'image_recognition' for visual analysis of images without text

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare openWorldHint=true, readOnlyHint=false, and idempotentHint=false, so the write/non-idempotent nature is covered structurally. The description adds the AI cascade strategy detail, which hints at cost/latency tradeoffs, but it omits that each call likely creates a new extraction record and says nothing about processing time or failure modes for unreachable URLs.

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?

Two short sentences, front-loaded with the action and followed by a strategy note. The second sentence borders on marketing phrasing but still carries a cost/accuracy signal, so little is wasted.

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?

With no output schema, the description should say what comes back (structured fields, an extraction id, or just a job handle), and it should clarify the layout-to-project relationship. It covers the core action adequately for a 3-parameter tool but leaves these practical gaps.

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 coverage is 100%, so parameters and the extraction_mode enum are already fully documented, which sets the baseline at 3. The description adds no parameter-level meaning and notably never explains how the 'predefined layout' relates to project_id.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: extracting structured data from an image using a predefined layout. It is distinguishable from siblings like get_extraction or list_extractions. However, the title mentions PDF while the description only says 'image', and 'predefined layout' is never tied to an identifiable parameter.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to call this versus list_extractions, get_extraction, or create_layout, and no mention of prerequisites such as a project already having a layout. The only implicit hint is a cost/accuracy remark, which does not function as usage routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources