Skip to main content
Glama

Extract PDF text and fields

pdf_extract_text
Read-onlyIdempotent

Extract the text layer of a PDF (pdfjs engine) plus optional rule-based structured fields (invoice or generic profile). Use this when the user needs the text of a PDF or wants key fields like invoice number, dates, totals, or contract parties pulled out.

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": {
      "file": "<file>"
    },
    "name": "pdf_extract_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesBase64-encoded file bytes (no data: URL prefix).
kindNo
filenameNoOriginal file name including extension.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive, so the safety profile is covered without the description. The description adds that extraction targets the text layer via the pdfjs engine and that fields are rule-based, but omits meaningful behavioral context such as what happens on image-only PDFs, the 11MB input cap, or failure modes.

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 compact sentences with the core action front-loaded and the trigger condition second; no filler. It could be marginally tighter, but every clause carries information an agent can use.

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 is expected to convey what comes back; it does gesture at 'text layer plus optional structured fields' but does not describe the shape or the fact that fields are empty when the profile does not match. For a 3-parameter extraction tool with a sibling OCR alternative, this is adequate but leaves gaps.

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 coverage is 67%, with the undocumented parameter being the 'kind' enum. The description compensates by explaining the profiles as 'invoice or generic,' giving the enum values meaning the schema alone does not supply, while file and filename already carry schema descriptions.

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?

The description names a specific verb and resource ('Extract the text layer of a PDF') plus the engine (pdfjs) and the optional structured-field layer. It implicitly separates itself from pdf_ocr via 'text layer,' but it never names the OCR sibling, leaving the most important sibling distinction to inference.

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?

It gives a positive trigger ('Use this when the user needs the text of a PDF or wants key fields...'), which is genuine usage guidance. However, it offers no exclusion condition, and the critical one for this tool family — scanned/image PDFs that need pdf_ocr instead — is absent.

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