headscale_policy
Validate, compare, retrieve, or replace a Headscale tailnet policy, with dry-run previews and explicit confirmation for writes.
Instructions
headscale_policy calls the policy toolset on a self-hosted Headscale server (4 actions). Authorization is Bearer. Writes need confirm set to the boolean true and HEADSCALE_ALLOW_WRITES=true. Omit confirm for a dry-run preview that does not send the write. Warnings: A bad policy can lock all nodes out of the tailnet. Actions: check_policy: POST /api/v1/policy/check. Validate a policy. Headscale does not save it. diff: GET /api/v1/policy. Compare a proposed policy with the saved policy. Sends only the policy read. get_policy: GET /api/v1/policy. Get the current policy. set_policy: PUT /api/v1/policy. Replace the tailnet policy.
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": {
"action": "<action>"
},
"name": "headscale_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | JSON body for the Headscale operation. Secrets are redacted in previews. | |
| query | No | OpenAPI query parameters. | |
| action | Yes | Headscale operation to call. | |
| params | No | OpenAPI path parameters, such as nodeId or id. | |
| confirm | No | Set to the boolean true to execute the write. Omit this field for a dry-run preview. false and the string true are rejected. |