Skip to main content
Glama

set_lifecycle

Destructive

Replace bucket lifecycle rules to expire current and noncurrent objects after a specified number of days. Supports dry-run and undo; does not abort multipart uploads.

Instructions

[WRITE][risk=medium] Replace the bucket lifecycle. Reversible → prior config.

Pass the day-count knobs (rules are built for you: current-version expiry, noncurrent-version expiry), or lifecycle_xml to apply a configuration verbatim (used by undo restores). REPLACES any existing rules — the prior config is captured for undo.

Aborting abandoned multipart uploads is NOT available here: MinIO refuses a lifecycle rule whose only action is that, and drops the action when it is combined with an expiration. Use remove_incomplete_uploads instead.

The undo restores the RULE, not the data: objects the rule expires before you undo are deleted, and putting the prior configuration back does not bring them back.

Args: bucket_name: Bucket name (from bucket_ls). expire_days: Expire current objects after N days. noncurrent_expire_days: Expire noncurrent versions after N days. prefix: Optional key prefix the rules apply to (empty = whole bucket). lifecycle_xml: Full lifecycle configuration XML to apply verbatim. dry_run: If True, preview without applying. target: MinIO target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
prefixNo
targetNo
dry_runNo
bucket_nameYes
expire_daysNo
lifecycle_xmlNo
noncurrent_expire_daysNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • removedInput schema / properties / abort_incomplete_days
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Abort Incomplete Days"
      -}
  2. First observedv0.7.0

TDQS

A5/5.0
Behavior5/5

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

Annotations declare destructive=true and non-idempotent, and the description adds substantial non-obvious context: that the prior config is captured for undo, that undo restores the rule but NOT expired data, and that MinIO drops a multipart-abort-only rule. This is exactly the kind of behavior an agent cannot infer from annotations alone.

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?

Front-loaded metadata tags ([WRITE][risk=medium]) then the replacement/reversibility warning, then mode guidance, then caveats, then args. Dense but every sentence adds a constraint the agent needs for a destructive write.

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?

No output schema exists, but the description covers all required behavior for a 7-param destructive mutation: reversibility, undo limits, dry_run, target resolution, and the excluded multipart case. Nothing material is missing.

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 carries the full burden and does: each of the 7 args is given semantics (bucket_name sourced from bucket_ls, prefix empty=whole bucket, lifecycle_xml verbatim, target omitted=default, dry_run preview). Nothing is left undocumented.

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?

Opens with a specific verb+resource ("Replace the bucket lifecycle") and immediately clarifies that it REPLACES existing rules, which cleanly separates it from delete_lifecycle and bucket_lifecycle_get. An agent can identify the operation without opening the schema.

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 between the two modes: day-count knobs for built rules vs lifecycle_xml for verbatim application (noting the undo path uses the latter). It also names a real alternative (remove_incomplete_uploads) and explains why the multipart-abort action is out of scope here.

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