Skip to main content
Glama

Evaluate Rego query

rego_eval

Evaluates a Rego query against a policy and input document using OPA, returning standard results to validate and debug policy logic.

Instructions

Evaluate a Rego query against a policy and an input document using opa eval. Returns the standard {result: [...]} shape. The bread-and-butter authoring tool.

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

B3.4/5.0
Behavior3/5

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

The description adds useful behavioral detail beyond annotations by disclosing the return shape: 'Returns the standard {result: [...]} shape.' However, it does not mention potential side effects from builtins like http.send, the mutual exclusivity of source/paths, or behavior under partial evaluation. The annotations only provide readOnlyHint=false and openWorldHint=true, so more transparency would help.

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?

The description is concise: two sentences, with the core purpose and output shape front-loaded. The 'bread-and-butter authoring tool' phrase adds a small amount of usage flavor but is slightly filler; nevertheless, the overall structure is tight and efficient.

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?

Given the tool has 8 parameters and no output schema, the description provides the essential top-level contract—evaluation semantics and the standard result shape—but it does not address caveats around partial evaluation, unknowns, or side effects. It also does not guide the agent toward the eval_with_* siblings when specialized output is needed, so completeness is adequate but not strong.

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 baseline of 3 applies. The description's phrase 'against a policy and an input document' provides a high-level mapping to the paths/source and input/inputPath parameters, but it does not add meaningful semantics beyond what the input schema already documents.

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 clearly identifies the verb and resource: it evaluates a Rego query against a policy and input document using `opa eval`, and even states the output shape. It stops short of a 5 because it does not explicitly distinguish itself from sibling tools like rego_eval_with_explain, rego_eval_with_profile, and rego_eval_with_coverage beyond the phrase 'standard'.

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

Usage Guidelines3/5

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

Calling this 'the bread-and-butter authoring tool' implies it is the default/basic evaluation tool, which offers some usage context. However, it never explicitly states when to prefer this tool over the eval_with_* variants or related tools like rego_check, so the guidance remains implicit rather than explicit.

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