Skip to main content
Glama

code_maintain

Cleans up missing or unused imports in touched files, previewing changes by default before applying them. Flags dead code without removing it automatically.

Instructions

Clean up imports in files you touched (missing/unused). plan = preview by default; dead code is never removed automatically, only flagged.

Input Schema

NameRequiredDescriptionDefault
filesNoScope; default task materials.
actionNoplan default; apply writes.
dry_runNotrue = preview.
task_idYesTask id.
proposalsNoFingerprints (default all safe).
request_idNoIdempotency key.
max_per_fileNoDefault 20.
workspace_dirYesProject root (abs).
max_candidatesNofix_imports candidates per file (default 10, 1-100).
expected_state_revisionNoOptimistic guard.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.28

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 burden. It usefully discloses that plan is the default and that dead code is only flagged, never removed — real safety context. However it omits that apply mutates files on disk, says nothing about idempotency (request_id) or the optimistic guard (expected_state_revision), leaving meaningful behavioral gaps for a 10-param write tool.

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?

Two tight clauses, front-loaded with the action, zero filler. It could be marginally clearer about what happens on apply, but nothing is wasted.

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?

No output schema and no annotations mean the description must carry safety and return semantics, yet it only covers the preview-flag and dead-code policy. For a 10-parameter mutation tool with fingerprints and revision guards, that is adequate but not complete.

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 every parameter is already documented and the baseline is 3. The description reinforces the plan/apply duality but adds no syntax beyond the schema (e.g. fingerprint semantics for proposals are left to the schema).

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 ('Clean up imports in files you touched') with the scope qualifier 'files you touched', which distinguishes it from a general patcher like code_patch. It stops short of naming a sibling, so 4 rather than 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?

'plan = preview by default' implies the safe-first workflow, and 'dead code is never removed automatically' implies a boundary. But there is no explicit statement of when to choose this over code_patch or edit_transaction, and no prerequisites given.

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