Skip to main content
Glama

media_restore_attachment

Restore an attachment's original file from backup and replace optimized versions. Use force to restore even if the attachment changed after optimization; backup cleanup prevents restore.

Instructions

Restore one attachment's original from its backup, replacing the optimized files. Fails when the backup was cleaned up; force: true restores even when the attachment was edited since.

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": {
      "site": "<site>",
      "id": "<id>"
    },
    "name": "media_restore_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesAttachment id
siteYesSite id (see list_sites)
forceNoRestore even if the attachment changed since optimizing

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0

TDQS

A3.7/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 meaningful work: it discloses that optimized files are replaced (a destructive outcome), that the call fails if the backup was purged, and what force:true overrides. It omits permission requirements, whether the replacement is reversible, and what the call returns, which keeps it below the top band.

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 sentences with no filler; the core action and its file-level consequence come first and the failure/override conditions follow. Every clause conveys actionable information.

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?

For a 3-parameter mutation tool with no annotations and no output schema, the description covers the key risk (overwriting optimized files) and the force override, but leaves gaps: no return-value expectations, no permission or scope requirements, and no note on whether the original optimization can be reapplied.

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 id, site, and force are already documented in the schema. The description's note that force restores even when the attachment was edited since optimizing largely restates the schema's force description rather than adding new meaning.

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 and resource (restore an attachment's original from backup) and scopes it to exactly one attachment, which implicitly separates it from the bulk sibling. It does not explicitly name an alternative such as media_undo_replace, so it stops short of full sibling differentiation.

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 rather than stated: an agent can infer this is the revert path for an optimized attachment. It gives a useful precondition (fails when the backup was cleaned up) but no explicit when-to-use versus when-not-to-use routing, and no guidance on choosing between this and other recovery tools.

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

Deploy Server

Other Tools