set_server_weight
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"backend": "<backend>",
"server": "<server>",
"weight": "<weight>"
},
"name": "set_server_weight"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | ||
| target | No | ||
| weight | Yes | ||
| backend | Yes | ||
| dry_run | No |