Skip to main content
Glama
OrygnsCode

opa-mcp-server

Generate Rego test skeleton

rego_generate_test_skeleton
Read-onlyIdempotent

Generate *_test.rego skeleton stubs for each rule from a Rego policy, optionally using table-driven every tc in cases { ... } loops for multiple inputs.

Instructions

Generate a *_test.rego skeleton from a policy. Parses the AST, finds each rule, and emits one stub test per rule. The agent fills in realistic inputs and assertions. With tableStyle: true, each stub uses an every tc in cases { ... } loop so you can add multiple input/expected pairs without duplicating assertion code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesRego source to generate tests for.
tableStyleNoGenerate table-driven test stubs instead of single-case stubs. Each rule gets a `cases` array and an `every tc in cases { ... }` assertion loop. Pair with `rego_test varValues: true` to see which case failed.
Behavior5/5

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

The description details the process (parsing AST, finding each rule, emitting one stub per rule) and the tableStyle effect. This adds context beyond the annotations (which already declare readOnly, non-destructive, idempotent). 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?

Four concise sentences front-load the purpose and then add necessary detail. Every sentence adds value with no fluff or repetition.

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?

Despite no output schema, the description explains the output format (stub tests, one per rule) and the tableStyle variant. It covers main behavior and limitations implicitly, which is sufficient for a read-only tool.

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

Parameters5/5

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

While schema coverage is 100%, the description enriches both parameters: it explains the overall generation process (for 'source') and details the tableStyle option's behavior (every/each loop). This goes beyond schema definitions.

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 uses a specific verb ('Generate'), identifies the output ('*_test.rego skeleton'), and explains the process (AST parsing, rule detection). It clearly distinguishes from siblings like rego_test (which runs tests).

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 implies usage: after generation, the agent fills in the stubs. However, it does not explicitly contrast with alternatives (e.g., rego_test) or state when not to use. Still context is clear enough.

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