Skip to main content
Glama

set_server_weight

Destructive

Adjust an HAProxy backend server's load-balancing weight (0-256) to control traffic or stop new requests; supports dry-run preview and restores the prior weight via undo.

Instructions

[WRITE][risk=medium] Set an haproxy server's load-balancing weight (0-256); reversible — the prior weight is fetched first and the undo restores it.

Weight 0 stops new traffic to the server without a state change. On traefik/caddy this raises the support matrix's teaching error. Pass dry_run=True to preview.

Args: backend: Backend name (from list_services). server: Server name inside the backend (from list_upstreams). weight: New weight, 0-256. dry_run: If True, preview without changing. target: Proxy target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
serverYes
targetNo
weightYes
backendYes
dry_runNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the prior weight is fetched and the undo restores it (reversibility), the special meaning of weight 0, the cross-proxy error on traefik/caddy, and the dry_run escape hatch. The destructiveHint/idempotentHint flags are enriched rather than merely restated.

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?

Front-loaded with the [WRITE][risk=medium] tag and the core reversible behavior before the secondary notes and Args list. Slightly more verbose than needed in the traefik/caddy aside, but every sentence carries usable information.

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 mutation tool with no output schema and no schema-level param docs, the description covers purpose, reversibility, error conditions, and preview mode. It could say more about the return shape or permission requirements, but nothing essential to calling it correctly is missing.

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 Args block carries the entire burden, and it documents all five parameters including provenance (backend from list_services, server from list_upstreams, target from config, omit for default) and the weight range. It is strong but omits edge details such as out-of-range handling.

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 (Set) and resource (an haproxy server's load-balancing weight), plus the value domain (0-256). An agent immediately knows what state this mutates and the range it accepts, which distinguishes it from sibling setters like set_server_state or set_config_value.

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?

Gives clear operational context: weight 0 stops new traffic without a state change, traefik/caddy raise a teaching error, and dry_run=True previews. It even names list_services and list_upstreams as sources for the required args. It stops short of explicitly contrasting with the sibling set_server_state, so it is not a full 5.

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