Skip to main content
Glama

Apply approved repository cleanup

codeinspectus_apply_cleanup
Destructive

Applies an approved cleanup plan to AI-generated source files after explicit confirmation, matching artifact IDs, creating backups, making bounded edits, and logging changes.

Instructions

Apply one exact ready V3.3 cleanup plan after explicit approval. Requires an exact artifact-ID match and confirmation, creates managed content backups, uses atomic bounded edits, creates new media copies, reruns the same repository-trust validators, and writes a content-free audit log. This modifies selected source files and/or creates named cleaned copies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYes
confirm_cleanupYesMust be true after the user reviews and approves the exact plan.
approved_artifact_idsYesExact artifact IDs approved by the user; must equal the plan scope.
confirm_rights_to_modifyNoRequired when removing explicit attribution or provenance; confirms the user is authorized to create the proposed change.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes
outcomeYes
plan_idYes
checkpointYes
cleanup_idYes
operationsYes
started_atYes
limitationsYes
completed_atYes
verificationYes
audit_log_pathYes
schema_versionYes
repository_trust_afterYes
repository_trust_beforeYes
repository_trust_changesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.3.1

TDQS

A4.3/5.0
Behavior5/5

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

Despite annotations already declaring destructiveHint=true and idempotentHint=false, the description adds substantial non-obvious behavior: managed content backups, atomic bounded edits, creation of new media copies, rerunning the same trust validators, and a content-free audit log. It also discloses the mutation surface ('modifies selected source files and/or creates named cleaned copies'), which annotations alone cannot convey.

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?

Front-loaded with the action and its precondition, then a dense but purposeful clause listing side effects. Three sentences with no filler, though the middle sentence is a long run-on list that could be broken up for scanability.

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 annotations covering the safety profile and an output schema present, the description is nearly complete for a destructive mutation tool. It omits failure semantics and whether partial application is possible, but rollback coverage is supplied by the sibling rollback_cleanup tool.

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 coverage is 75% and the description only echoes the artifact-ID match and confirmation requirement already documented in the schema. It adds no syntax or format detail for plan_id and never mentions confirm_rights_to_modify, so the remaining coverage gap is not compensated. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Apply) plus resource (cleanup plan) and constrains scope to 'one exact ready V3.3 cleanup plan', which cleanly separates it from the sibling that produces plans (codeinspectus_plan_cleanup) and the one that reverses them (codeinspectus_rollback_cleanup). An agent can place this tool in the workflow without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Preconditions are explicit: the plan must be 'ready' and applied only 'after explicit approval', with an exact artifact-ID match and confirmation required. It stops short of naming alternatives such as plan_cleanup or rollback_cleanup, so the routing guidance is implied by the workflow stage rather than stated.

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