Skip to main content
Glama

Evaluate Rego with execution trace

rego_eval_with_explain

Evaluate a Rego query with a full structural trace to show why a rule fired or didn't. Use this to debug policy decisions and provide the trace for explanation.

Instructions

Evaluate with --explain=full and return a structured trace alongside the result. Use this when an agent needs to see why a rule fired (or didn't) -- the trace is the basis for rego_explain_decision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputNoInline input document.
pathsNoPolicy / data file or directory paths. Each must be inside an allowed root.
queryYesRego query to evaluate, e.g. "data.example.allow".
sourceNoInline Rego policy source. Mutually exclusive with `paths`.
partialNoRun partial evaluation rather than full evaluation.
unknownsNoRefs to treat as unknown during partial evaluation.
inputPathNoPath to a JSON input file. Mutually exclusive with `input`.
strictBuiltinErrorsNoTreat builtin errors as fatal instead of returning undefined.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.13
  2. Removedv0.1.5
  3. Addedv0.1.2
  4. Removedv0.1.1
  5. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

The annotations provide readOnlyHint=false and openWorldHint=true, so the description carries some burden for behavioral disclosure. It adds useful behavior beyond annotations by specifying `--explain=full` and the structured trace output, but it does not discuss side effects, output size, or error behavior. No contradiction with annotations.

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?

The description is two sentences with the core behavior front-loaded and the usage context in the second sentence. There is no filler, and every sentence earns its place.

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

Completeness3/5

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

There is no output schema, so the description should explain return values more concretely; it only says 'structured trace alongside the result' without detailing trace shape or caveats. The 8 parameters are fully schema-documented, so the gap is moderate rather than severe.

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 the input schema already documents all 8 parameters. The description adds context about the evaluation mode but no parameter-level meaning beyond what the schema provides, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: evaluate Rego with `--explain=full` and return a structured trace alongside the result. It clearly differentiates from plain evaluation via the trace, though it does not explicitly name `rego_eval` as the non-trace sibling.

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?

The description explicitly says to use this tool when an agent needs to see why a rule fired or didn't, and it connects the trace to `rego_explain_decision`. It does not provide when-not-to-use guidance or name alternatives directly, but the intended usage context is clear.

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