Skip to main content
Glama
OrygnsCode

opa-mcp-server

Diff two Rego policies

rego_policy_diff
Read-onlyIdempotent

Compare two Rego policies by executing the same query against both and returning the changed paths and equality result. Ensures refactor behavior is preserved.

Instructions

Evaluate the same query against two policies (or two versions of the same policy) and compare the results. Both evaluations run in parallel. Returns equal: true/false, the raw result from each side, and changedPaths -- the dot/bracket paths that differ. Useful for verifying that a refactor preserves behavior, or understanding exactly where two policies diverge. Each side takes either inline source (sourceA/sourceB) or a file/directory path (pathA/pathB). The same input and query are used for both evaluations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceANoInline Rego source for policy A. Mutually exclusive with pathA.
pathANoFile or directory path for policy A. Must be inside an allowed root. Mutually exclusive with sourceA.
sourceBNoInline Rego source for policy B. Mutually exclusive with pathB.
pathBNoFile or directory path for policy B. Must be inside an allowed root. Mutually exclusive with sourceB.
queryYesThe query to evaluate against both policies, e.g. "data.example.allow".
inputNoInline input document (JSON). Mutually exclusive with inputPath.
inputPathNoPath to a JSON input file. Must be inside an allowed root. Mutually exclusive with input.
dataPathsNoAdditional data or policy paths loaded for both evaluations. Each must be inside an allowed root.
Behavior4/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true, so the description correctly adds context beyond annotations: 'Both evaluations run in parallel' and explains the return value structure (equal, raw result, changedPaths). No contradictions.

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 concise (3-4 sentences), well-structured, and front-loaded with the core purpose. Every sentence adds value with no redundancy.

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?

Given 8 parameters and no output schema, the description explains the return values (equal, raw result, changedPaths) and the shared input/query concept. It covers the main behavioral aspects, though it omits error handling or path validation details.

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

Parameters4/5

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

Schema coverage is 100%, baseline 3. The description adds meaning by explaining the mutual exclusivity of source/path parameters and that input/query are shared: 'Each side takes either inline source ... or a file/directory path ... The same input and query are used for both evaluations.' This goes beyond the schema's description.

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?

The description clearly states the tool's purpose: 'Evaluate the same query against two policies ... and compare the results.' It uses a specific verb and resource, and the mention of diffing distinguishes it from sibling tools like rego_eval or rego_test.

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 includes usage guidelines such as 'useful for verifying that a refactor preserves behavior, or understanding exactly where two policies diverge.' While it does not explicitly list when not to use or alternative tools, the context provided is sufficient for an agent to infer appropriate vs. inappropriate use cases.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OrygnsCode/opa-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server