Skip to main content
Glama

Rego test coverage gaps

rego_coverage_gaps
Read-onlyIdempotent

Run opa test coverage to find uncovered Rego rules and branches, returning a per-file report sorted by coverage ascending, with an optional threshold to highlight files below a target percentage.

Instructions

Run opa test --coverage and return a per-file breakdown of uncovered line ranges. Identifies which rules or branches are not yet exercised by tests. Files are sorted by coverage ascending so the worst-covered files appear first. Use threshold to limit the report to files below a target coverage percentage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesTest directories or files. opa test looks for *_test.rego siblings of source files.
thresholdNoReport only files below this coverage percentage (0-100). When omitted, all files with uncovered ranges are reported.
runPatternNoRun only tests whose names match this regex.
Behavior5/5

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

Annotations declare readOnly, destructive false, idempotent. Description adds behavioral context: runs opa test, sorts output, threshold usage. 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?

3-4 sentences, front-loaded with key action, no unnecessary words.

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?

Covers purpose, sorting, threshold. Omitted runPattern parameter. No output schema, so description could be more specific about output structure. Adequate for most use.

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 covers all 3 params with descriptions. Description repeats threshold's purpose but doesn't add new meaning beyond schema. runPattern not mentioned in 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?

Clear verb+resource+scope: runs opa test --coverage, returns per-file breakdown of uncovered line ranges, sorts by coverage ascending. Distinguishes from sibling rego_test by focusing on gaps, not test pass/fail.

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?

States purpose (coverage gap analysis) and mentions threshold filtering but does not explicitly compare to siblings like rego_test or rego_eval_with_coverage. Agent can infer use case but no direct when-not guidance.

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