Skip to main content
Glama

pdf_repair

Repair corrupted or malformed PDFs by rewriting the cross-reference table and save the repaired file to a chosen output path.

Instructions

Repairs a corrupted or malformed PDF by rewriting its cross-reference table.

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": {
      "input": "<input>",
      "output": "<output>"
    },
    "name": "pdf_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesPath to the PDF to repair.
outputYesPath to save the repaired PDF.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description carries the full behavioral burden. It does add real signal by disclosing the mechanism (cross-reference table rewrite), which implies it only addresses structural/xref corruption and not damaged content streams, but it says nothing about failure behavior, data-loss risk, or whether the output can overwrite the input.

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?

A single front-loaded sentence with no filler; the mechanism clause earns its place by narrowing expectations about what 'repair' means.

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 two-parameter, non-destructive-looking file tool with a fully documented schema and no output schema, the description covers what it does and how. Missing only safety/failure details, which are low-stakes for a tool that writes to a separate output path.

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?

Both parameters are fully described in the schema (100% coverage), so the schema does the work. The description adds no extra meaning such as whether output may equal input or whether directories are created.

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 (repairs) and resource (corrupted or malformed PDF) plus the mechanism (rewriting the cross-reference table). It is naturally distinguishable from the conversion/editing siblings, though it never explicitly contrasts itself with any of them.

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?

No guidance on when to reach for this tool versus, say, re-converting or re-generating the PDF, and no preconditions such as working on a copy or what kinds of corruption it can and cannot fix. Usage is left entirely to inference from the tool name.

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