Skip to main content
Glama

check_policy

Read-onlyIdempotent

Dry-run a planned action against the project's .q-ring.json policy before executing it. Returns whether the tool call, secret read, or command is allowed, plus the reason and policy source.

Instructions

[policy] Ask whether a single intended action would be allowed by the project's .q-ring.json policy without actually performing it. Use as a dry-run before calling a potentially-blocked tool, attempting to read a sensitive key, or invoking exec_with_secrets with a non-trivial command; prefer get_policy_summary for a one-shot overview of the entire policy. Read-only. Returns JSON { allowed, reason?, policySource } describing the decision. Returns an error 'Missing required parameter for the selected action type' if the matching argument for the chosen action is not supplied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoSecret key name to evaluate. Required when `action` is 'key_read'.
actionYesWhich policy surface to query. 'tool' = MCP tool gate (needs `toolName`); 'key_read' = secret read gate (needs `key`); 'exec' = exec_with_secrets command gate (needs `command`).
commandNoCommand to evaluate against the exec allowlist/denylist. Required when `action` is 'exec'.
toolNameNoTool id to evaluate, e.g. 'rotate_secret'. Required when `action` is 'tool'.
projectPathNoAbsolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.11.7
    • changedInput schema / properties / action / description
      Previous value: -"Type of policy check"New value: +"Which policy surface to query. 'tool' = MCP tool gate (needs `toolName`); 'key_read' = secret read gate (needs `key`); 'exec' = exec_with_secrets command gate (needs `command`)."
    • changedInput schema / properties / command / description
      Previous value: -"Command to check (for action=exec)"New value: +"Command to evaluate against the exec allowlist/denylist. Required when `action` is 'exec'."
    • changedInput schema / properties / key / description
      Previous value: -"Secret key to check (for action=key_read)"New value: +"Secret key name to evaluate. Required when `action` is 'key_read'."
    • changedInput schema / properties / projectPath / description
      Previous value: -"Project root path for project-scoped secrets"New value: +"Absolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted."
    • changedInput schema / properties / toolName / description
      Previous value: -"Tool name to check (for action=tool)"New value: +"Tool id to evaluate, e.g. 'rotate_secret'. Required when `action` is 'tool'."
  2. Addedv0.11.5

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so 'Read-only' adds little; the real value is the disclosed return shape `{ allowed, reason?, policySource }` and the documented error 'Missing required parameter for the selected action type'. It could go further on performance or resolution nuances, but it meaningfully extends beyond annotations.

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

Conciseness4/5

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

Front-loads the core purpose, then usage guidance, then return/error behavior in a logical order. Slightly dense with a few overlapping clauses (the redundant 'Read-only' plus the long error sentence), but every sentence carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description supplies the return shape and the key error case, and the routing to `get_policy_summary` closes the main sibling-selection gap. An agent has everything needed to call this correctly.

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 description coverage is 100%, so each parameter and its action-specific requirement is already fully documented in the schema. The description only restates that the matching argument must be supplied for the chosen `action`, adding no new syntax or format detail beyond the schema baseline.

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 and resource: ask whether a single intended action would be allowed by the project's `.q-ring.json` policy without performing it. It explicitly distinguishes itself from the sibling `get_policy_summary` by contrasting a single-action dry-run with a whole-policy overview.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use triggers (before calling a potentially-blocked tool, reading a sensitive key, or invoking `exec_with_secrets` with a non-trivial command) and names the alternative (`get_policy_summary`) with the condition that selects it. Nothing is left to inference.

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