Skip to main content
Glama

PDF Efforts

Repair PDF

repair_pdf
Idempotent

Rebuild the internal structure of a damaged or corrupted PDF (qpdf, with a Ghostscript fallback).

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": "repair_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe damaged PDF.

Output Schema

NameRequiredDescriptionDefault
infoNoFacts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf).
noteNoAnything the user should know about the result.
textNoExtracted text (pdf_to_text, ocr_pdf).
filesYesResult files. Download them before expires_at; pass file_id to another tool to chain.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already establish mutation behavior, idempotency, open-world access, and non-destructiveness. The description adds implementation context (qpdf with Ghostscript fallback), but it does not explain whether the original is replaced, how output is produced, or what repair limitations exist.

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 definition is a single front-loaded sentence with no wasted wording. The qpdf/Ghostscript parenthetical adds useful implementation context without bloating the description.

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?

For a simple one-input repair tool with an output schema and meaningful annotations, the definition is largely sufficient for correct invocation. Its main gap is the lack of explicit guidance about when to choose repair versus other PDF tools.

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?

The single input is a nested file object whose fields have 100% schema description coverage. The description adds no additional meaning about the file input, so the schema carries the parameter semantics.

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 uses a specific verb and resource: "Rebuild the internal structure" of a "damaged or corrupted PDF." The damage/corruption condition helps distinguish it from normal PDF utilities, but it does not explicitly name or route against sibling tools.

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?

Usage is implied by "damaged or corrupted PDF," so an agent can infer this is for broken files. However, there is no explicit when-to-use versus alternatives, no when-not guidance, and no prerequisites or failure conditions.

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