Skip to main content
Glama
ginkida

portainer-mcp

by ginkida

portainer_service_update

Update a Docker Swarm service by changing its image, adjusting replica count, or forcing a task restart. Applies desired changes to the service spec and triggers a rolling update to converge the deployment.

Instructions

Update a Swarm service: change its image, scale it, or force a restart.

Reads the current spec and version, applies the requested changes and submits the spec back (rolling update per the service's UpdateConfig). At least one of image / replicas / force_restart is required. Follow up with portainer_service_wait to know when the rollout converged.

To roll out a new build of the same :latest tag, pass image= ":" without a digest — Swarm resolves the tag to its current digest at update time. force_restart alone re-creates the tasks with the image digest already pinned in the spec.

Args: service_id: Service ID or name image: New image reference (e.g. "registry.example.com/app:latest") replicas: New replica count (replicated services only) force_restart: Re-create all tasks even if the spec is unchanged (docker service update --force) registry_id: ID of a Portainer-configured registry whose stored credentials the nodes should use to pull the image (auto-detected from the image host when omitted; 0 = none) endpoint_id: Target endpoint ID (uses default if omitted)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageNo
replicasNo
service_idYes
endpoint_idNo
registry_idNo
force_restartNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv0.8.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the internal process: 'Reads the current spec and version, applies the requested changes and submits the spec back (rolling update per the service's UpdateConfig).' It also details behavior for force_restart ('re-creates the tasks even if the spec is unchanged') and how image tag resolution works ('Swarm resolves the tag to its current digest at update time'). This is rich behavioral context beyond the schema.

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 description is well-structured with a clear opening sentence, a brief operational overview, and a bulleted list of parameters. It front-loads the primary purpose and includes necessary details without redundancy. It is a bit longer than minimal, but each sentence serves a purpose (e.g., explaining the :latest edge case, which is important). No wasted words.

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?

Given the tool's complexity (6 parameters, one required, update operation) and the presence of an output schema (so return values need not be explained), the description is complete. It covers required fields, the follow-up tool, parameter nuances, and operational behavior. It does not mention potential side effects or failure handling, but those are minor given the output schema and the clear workflow.

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. It does so thoroughly: each parameter is explained with meaningful detail. For example, image is given an example format, registry_id explains auto-detection and 0 meaning none, endpoint_id notes default behavior, and force_restart is equated to 'docker service update --force'. This fully addresses the parameter semantics gap.

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 opens with 'Update a Swarm service: change its image, scale it, or force a restart.' This states a clear verb (update), resource (Swarm service), and enumerates the specific operations. It distinguishes from siblings like portainer_service_rollback (which reverts to a previous spec) and portainer_service_inspect (read-only). The purpose is unambiguous.

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 provides explicit usage context: it states the required parameter set ('At least one of image / replicas / force_restart is required') and instructs to 'Follow up with portainer_service_wait to know when the rollout converged.' It explains how to use it for rolling out a new build with a :latest tag. However, it does not explicitly contrast with alternatives like portainer_service_rollback or portainer_stack_update, so it lacks explicit when-not-to-use guidance. This is a minor gap.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ginkida/portainer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server