Skip to main content
Glama

Set registry retention

set_registry_retention
Destructive

Change which images the organisation's registry keeps, so it stops filling up: the organisation-wide policy (default), and/or the per-repository rules (rules). Omitted fields stay unchanged. default sets the organisation-wide policy; reset_default true puts it back on the platform default instead. rules REPLACES the whole list of repository rules: read the current rules with get_registry_storage first and send the complete list you want, including the rules to keep; an empty list removes every rule. Pass the retention.version you read as expected_version: if retention changed since, the call is refused ("Retention changed since you read it") - read it again and rebuild the change, never retry the same arguments. A rule replaces the default for the repositories its pattern matches (lowercase, * within a path segment, ** across segments, e.g. ankra-ci/** for the pipeline's build images or my-app/**; ** alone is refused - use default). An image is kept when pushed within keep_days or among the keep_latest newest of its repository. Protections whatever you choose: the newest image of every repository is always kept, and images pulled in the last 7 days are kept. Images outside the policy are deleted at the next daily run (or now with run_registry_retention); the space comes back only at the weekly garbage collection (Sunday 03:00 UTC). Requires credentials.write.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "set_registry_retention"
  }
}

Input Schema

NameRequiredDescriptionDefault
rulesNoThe COMPLETE list of repository rules after the change (it replaces the current list). Omit to leave the rules unchanged; an empty list removes them all.
defaultNoThe new organisation-wide policy for every repository no rule covers. Omit to leave it unchanged.
reset_defaultNotrue puts the organisation-wide policy back on the platform default. Do not combine with default.
expected_versionNoAlways send the retention.version get_registry_storage returned when you read the rules: if someone changed retention since, the change is refused instead of overwriting theirs - read again and rebuild the change. Omit it only when that read returned no version.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and non-idempotent, and the description adds substantial context beyond them: rules REPLACES the whole list, an empty list deletes all rules, the newest image per repository and images pulled in the last 7 days are always protected, deletions happen at the next daily run with space reclaimed only at weekly GC, and credentials.write is required. The optimistic-concurrency refusal message is spelled out. Minor gap: it doesn't say whether a partial failure across rules is atomic.

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?

Dense and front-loaded, with the destructive replace semantics and the read-first workflow stated early. A few clauses restate schema content (e.g. 'default sets the organisation-wide policy'), and the protections/timing details make it long, but nearly every sentence carries operational weight.

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?

For a destructive, non-idempotent mutation with nested objects and no output schema, the description covers concurrency control, replacement semantics, protections, deletion timing, and auth requirements. An agent has everything needed to call it safely.

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 coverage is 100%, yet the description still adds real meaning: expected_version is tied to the version returned by get_registry_storage with a read-again-and-rebuild instruction, reset_default is contrasted with default, and pattern syntax (lowercase, * within a segment, ** across segments, '**' alone refused) is explained with examples.

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 and resource ('Change which images the organisation's registry keeps') and immediately frames the two levers (organisation-wide default vs per-repository rules), which distinguishes it from get_registry_storage and run_registry_retention.

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

Usage Guidelines5/5

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

Explicitly routes the agent: read current rules with get_registry_storage first, use run_registry_retention to apply immediately, use reset_default instead of default, and never combine the two. It also states the when-not case for '**' alone (use default).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.