Preview or confirm a policy assignment
apply_policy_to_endpointsPreviews target computers and commits a policy assignment to selected endpoints, hostnames, or groups using a server confirmation token.
Instructions
Requires policies:write and endpoints:read. Preview exactly one selector: endpoint_ids for one/many computers, hostname_pattern, or group_ids. Groups include current subgroup members by default, capped at 500 eligible computers; no future-member binding. Show the concrete computers, policy status/mode and replacement warning to the human. After approval call again with ONLY policy_id and confirmation_token from that preview. confirm=true alone cannot commit. The one-time server token freezes the target IDs; stale policy/assignments or ineligible computers reject the whole operation. This replaces desired assignments and may remove existing protections or schedule an enforcing policy. Success means desired state is saved, not that computers have installed it. Never automatically retry writes.
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": {
"policy_id": "<policy_id>"
},
"name": "apply_policy_to_endpoints"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Legacy flag: true without a server confirmation_token is rejected | |
| platform | No | Hostname selector only: optional platform filter | |
| group_ids | No | Existing group IDs; exclusive with endpoint_ids/hostname_pattern | |
| policy_id | Yes | Policy ID to assign | |
| endpoint_ids | No | One or more endpoint IDs; exclusive with hostname_pattern/group_ids | |
| hostname_pattern | No | Case-insensitive hostname glob; exclusive with endpoint_ids/group_ids | |
| confirmation_token | No | Server token: commit uses only policy_id and this token after approval | |
| include_descendants | No | Group selector only: include subgroups, default true |