set_server_state
Change an HAProxy server's admin state to ready, drain, or maint, with dry-run preview and reversible undo that restores the prior state.
Instructions
[WRITE][risk=medium] Set an haproxy server's admin state (ready / drain / maint); reversible — the prior admin state is fetched first and the undo restores it.
drain finishes in-flight sessions but takes no new ones; maint removes the server immediately; ready returns it to rotation. 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). state: One of ready, drain, maint. 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>",
"state": "<state>"
},
"name": "set_server_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| server | Yes | ||
| target | No | ||
| backend | Yes | ||
| dry_run | No |