Skip to main content
Glama
magicsword-io

magicsword-mcp

Official

Assign a policy to endpoints

apply_policy_to_endpoints
Destructive

Assign a policy to endpoints by resolving endpoint IDs or a hostname pattern, previewing the target set, then applying it after confirmation.

Instructions

Resolves either an explicit endpoint_ids list or a hostname_pattern (glob) into a concrete set of endpoints, then previews the concrete assignment. Rerun with confirm=true after human approval to apply it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNoSet true only after a human approves the resolved preview
platformNoOptional platform filter, applied when resolving hostname_pattern
policy_idYesThe policy UUID to assign
endpoint_idsNoExplicit list of endpoint UUIDs. Mutually exclusive with hostname_pattern.
hostname_patternNoGlob pattern (case-insensitive) matched against computer_name. Mutually exclusive with endpoint_ids.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=false), the description discloses the human-approval gating and the preview-before-apply two-phase contract, which is real behavioral context an agent must honor. It does not say what applying overwrites (e.g., replacing an existing policy assignment) or what the preview returns, so it is not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero filler, and the sequence of operations (resolve/preview, then confirm) is front-loaded. Every clause earns its place.

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 destructive, non-idempotent mutation with no output schema, the description covers the essential workflow and the safety gate. The remaining gap is the preview result itself — with no output schema, the definition never explains what the resolved endpoint set or preview response looks like, which matters for the approval step.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents policy_id, endpoint_ids (mutually exclusive, max 500), hostname_pattern (case-insensitive glob on computer_name), platform, and confirm. The description mostly restates the endpoint_ids/hostname_pattern duality and adds no new syntax or format detail, so baseline 3 applies.

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+resource (assign a policy to endpoints) and describes the two-stage mechanism: resolve endpoint_ids/hostname_pattern into a concrete set, preview, then apply. Nothing here overlaps with siblings like flip_to_enforcing or manage_policy_rules, so an agent can route correctly.

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 operating instructions: the first call previews, and the tool should be rerun with confirm=true only after human approval. It also signals that exactly one of endpoint_ids/hostname_pattern drives the resolution. It stops short of naming an alternative tool or stating when this assignment is preferable to other policy operations.

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