Skip to main content
Glama

restore_missing_pdf_images

Restore missing legacy embedded-image files from original PDFs. Validates reconstruction against database rows and surviving files before writing, with dry-run preview.

Instructions

Restore missing legacy embedded-image files from their original PDFs.

Restoration is fail-closed: the reconstructed PDF sequence must match every database row and every surviving file byte-for-byte before any file is written. The call never changes research Markdown or figure database rows.

Args: note_paths: Explicit vault-relative article paths; at most 20. dry_run: Validate and list the next bounded restore batch without writes. note_limit: Maximum supplied notes to inspect; 1 through 20. image_limit: Maximum missing image files to restore; 1 through 20. source_pdfs: Optional local PDF paths aligned with note_paths, for an explicitly verified copy when the recorded File Provider path is unavailable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNo
note_limitNo
note_pathsYes
image_limitNo
source_pdfsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses fail-closed all-or-nothing semantics, byte-for-byte verification before any write, an explicit guarantee that Markdown and figure DB rows are untouched, and that dry_run defaults to true. It omits permission/auth requirements and rollback behavior on mid-batch failure, keeping it below 5.

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?

The core semantics (fail-closed, no side effects) are front-loaded in two tight sentences, followed by a compact Args block that earns its space given 0% schema coverage. The prose is slightly longer than strictly necessary, preventing a 5.

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 no-annotation write tool with an output schema, the definition covers failure semantics, side-effect guarantees, limits/defaults, and the fallback path. Return-value details are rightly omitted since an output schema exists. Only auth/permission and partial-failure recovery details are missing.

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 description coverage is 0%, so the description must compensate, and it documents all five parameters with real semantics: the ≤20 cap on note_paths, the 1–20 ranges for both limits, dry_run's validate-without-writing meaning, and that source_pdfs must align positionally with note_paths and is only for a verified copy. Only minor gaps remain (e.g. behavior if source_pdfs length mismatches note_paths).

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 opening sentence gives a specific verb+resource ('Restore missing legacy embedded-image files from their original PDFs') and immediately scopes it to legacy PDF-sourced images, which is enough to separate it from generic figure tools. It does not explicitly distinguish itself from near-neighbors like reconcile_figures, so it falls short of a 5.

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 context is implied by the fail-closed explanation and the dry_run default, telling the agent this is a validate-then-write workflow. However, it never states when to prefer this over reconcile_figures or backfill_figure_text, nor any preconditions for invoking it, so the when-to-use guidance is only inferred.

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