Skip to main content
Glama

Repair a PDF

pdf_repair
Idempotent

Repair damaged PDFs in superPDF AI by rebuilding their cross-reference table, saving the fixed copy to a new file, and reporting what was fixed.

Instructions

Rewrite a damaged PDF and rebuild its cross-reference table. Reports what was fixed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
outputYesPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytesYes
fixedYes
pagesYes
outputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare the safety profile (destructiveHint=false, idempotentHint=true, openWorldHint=false), so the bar is lower. The description adds useful mechanism context — rebuilds the cross-reference table and emits a report of what was fixed — but says nothing about authorization/folder-permission requirements or how it behaves on unrecoverable files, which is the kind of detail a caller of a repair tool would want.

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?

Two short sentences with no filler; the core action ('rewrite a damaged PDF') is front-loaded and the secondary behavior (report of fixes) follows. Every sentence earns its place.

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?

With an output schema present, the description needn't explain return values, and annotations cover safety semantics. What it supplies — the rewrite plus xref rebuild and the reporting behavior — is sufficient to call the tool correctly, though a note on failure behavior for irreparable files would round it out.

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 description coverage is 100%, so the two parameters (input, output) are fully documented in the schema, including the allowed-folder constraint and the no-overwrite rule. The description adds no parameter-level detail, which is the expected baseline when the schema does the work.

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 gives a specific verb and object: 'Rewrite a damaged PDF and rebuild its cross-reference table.' That is far more precise than the title alone and clearly distinguishes it from sibling operations like pdf_unlock, pdf_flatten, or pdf_extract_structure. It stops short of naming a sibling it could be confused with, so it falls just under the top mark.

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?

The phrase 'a damaged PDF' implies the trigger condition, but there is no explicit when-to-use statement, no when-not-to-use, and no routing to alternatives (e.g., use pdf_unlock for encrypted files or pdf_info to diagnose first). Usage is inferable but not stated.

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