Skip to main content
Glama

Extract freight document

extract_bol

Extract structured data from a freight document (PDF, PNG or JPG, max 10 MB): Bill of Lading, commercial invoice, packing list, or CMR road waybill. The document type is detected automatically and returned as doc_type. Provide either a fetchable url or base64 file content. Fields not present in the document are null — never guessed. Each successful extraction bills one document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL of the document to fetch and extract
base64NoBase64-encoded file content (alternative to url)
filenameNoFilename including extension, e.g. shipment-4711.pdf

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Adds valuable context beyond the annotations: automatic doc_type detection, strict null-for-missing-fields policy ('never guessed'), file format/size limits, and billing ('each successful extraction bills one document'). These details are not present in the annotations and help the agent anticipate side effects and accuracy guarantees.

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 three sentences, front-loaded with the core purpose, then efficiently covers input methods, output behavior, and billing. Every sentence contributes essential information with no redundancy or filler.

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 there is no output schema, the description does reasonably well by stating that doc_type is returned and that absent fields are null. However, it does not enumerate the specific structured fields that can be extracted, which would be important for an agent to understand the full output. The tool handles multiple document types with variable fields, so this gap prevents a 5.

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?

The input schema already has 100% parameter description coverage, so the baseline is 3. The description adds the key relationship that 'url' and 'base64' are alternatives, clarifying that exactly one should be provided. This is a meaningful addition beyond the schema, justifying a 4.

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 opens with a specific verb and resource: 'Extract structured data from a freight document' and enumerates supported document types (Bill of Lading, commercial invoice, packing list, CMR waybill). This clearly distinguishes it from sibling tools like extract_batch, which handles batch extraction, and get_document, which likely retrieves existing documents.

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 gives clear context for use: supported file formats and size, input methods (url or base64), and the per-document billing implication. However, it does not explicitly contrast with alternative tools such as extract_batch or state when batch extraction would be more appropriate, leaving some inference to the agent.

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