Skip to main content
Glama

recreate_stack

Destructive

Redeploy a Portainer stack by recreating it, capturing its definition for audit before changes. Use dry_run to preview, since the action has no undo.

Instructions

[WRITE][risk=high] Redeploy (recreate) a Portainer stack. No undo.

Captures the stack definition for audit before Portainer recreates it; there is no clean inverse for a redeploy. Requires a portainer target. Pass dry_run=True to preview.

Args: stack_id: Portainer stack id. endpoint_id: Endpoint id the stack runs on; omit to use the stack's own. dry_run: If True, preview without recreating. target: Target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
targetNo
dry_runNo
stack_idYes
endpoint_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety profile is covered. The description still adds meaningful context beyond them: 'No undo', the audit capture of the stack definition beforehand, and the requirement of a portainer target.

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?

The [WRITE][risk=high] tag and the 'No undo' warning are front-loaded, and the Args block is compact. Minor redundancy between 'Redeploy (recreate)' and the later audit sentence, but nothing wasteful enough to harm the definition.

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?

For a non-idempotent mutation with an output schema absent, the description covers the destructive consequence, the irreversibility, the dry-run escape hatch, and every parameter. Sufficient for an agent to call it correctly; only the preview's return shape is left unstated.

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

Parameters4/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 load and does so: it documents all four params, including the fallback semantics for endpoint_id ('omit to use the stack's own') and target ('omit for the default'). It stops short of format examples for stack_id.

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 ('Redeploy (recreate) a Portainer stack') and immediately distinguishes it from plain restarts via the redeploy semantics. An agent can tell this apart from restart_container or stack_detail without opening another schema.

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?

It gives conditional usage for one param ('Pass dry_run=True to preview') and a prerequisite ('Requires a portainer target'), but never names when to choose this over alternatives such as restart_container or the undo_list/undo_apply pair. Usage is implied rather than routed.

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