Skip to main content
Glama
Artifact Registry MCP Server

Artifact Registry MCP Server

by Pawangunjkar

artifact_cleanup_old_snapshots

Prune stale snapshot artifacts by preserving the latest N versions and deleting older ones, with dry-run simulation by default to reclaim storage and enforce retention policies.

Instructions

Identify and prune stale snapshot artifacts to reclaim storage.

⚠️ CONFIRMATION-GATED MUTATING TOOL: Requires dry_run=false AND confirm=true to delete.

Finds all snapshot versions of a component, sorts by timestamp/version descending, preserves the latest keep_latest_n snapshots, and simulates or deletes stale items.

Purpose: Maintain storage quotas and enforce artifact retention policies. When to Use: In Workflow 4 during scheduled maintenance or when storage alerts trigger. Behavior: Dry-run simulation by default. Destructive deletion when dry_run=false and confirm=true. Side Effects: Permanently deletes pruned snapshot artifacts when executed.

Args: repository: Repository containing snapshot artifacts (e.g. 'maven-snapshots', 'libs-snapshot-local') component_name: Name of the component to clean up (e.g. 'billing-engine') keep_latest_n: Number of most recent snapshots to preserve (default: 5) dry_run: If True, simulates cleanup without deleting files (default: True) confirm: Must be True when dry_run=False to execute permanent deletion (default: False) session_name: Session to use (default: 'default')

Input Schema

NameRequiredDescriptionDefault
confirmNo
dry_runNo
repositoryYes
session_nameNodefault
keep_latest_nNo
component_nameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well. It discloses that the tool is confirmation-gated and mutating, defaults to dry-run simulation, requires dry_run=false and confirm=true for permanent deletion, and explicitly warns about permanent side effects.

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?

The description is front-loaded with the safety warning, then structured into Purpose, When to Use, Behavior, Side Effects, and Args. Despite some repetition between the warning and behavior sections, every part earns its place by supporting safe invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return value details are not required in the description. For a destructive cleanup tool, the description supplies purpose, usage context, safety gating, side effects, and all parameter semantics needed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 six parameters. It explains repository, component_name, keep_latest_n, dry_run, confirm, and session_name with defaults and examples, adding substantial meaning beyond the bare schema.

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?

The description states a specific verb and resource: identify and prune stale snapshot artifacts to reclaim storage. It explains the algorithm of finding snapshot versions, sorting them, preserving the latest N, and deleting the rest, which clearly distinguishes this cleanup operation from siblings such as upload, search, and promote.

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?

The description gives an explicit usage context: Workflow 4 during scheduled maintenance or when storage alerts trigger. It also clarifies the dry-run versus destructive execution path, though it does not name alternatives or state when not to use the tool.

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