Skip to main content
Glama
OrygnsCode

opa-mcp-server

Auto-fix Rego violations

rego_fix
DestructiveIdempotent

Automatically apply mechanical fixes to Rego policy files for formatting, deprecated syntax, and directory package mismatches. Preview changes with dry run before modifying files.

Instructions

Run regal fix to automatically apply mechanical fixes for the five rules regal 0.30.0 supports: opa-fmt, use-rego-v1, use-assignment-operator, no-whitespace-comment, and directory-package-mismatch. Use dryRun: true to preview changes before modifying files. NOTE: directory-package-mismatch moves files to match their package path -- use disable: ["directory-package-mismatch"] to skip it. Files with uncommitted git changes require force: true. Requires regal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesPolicy files or directories to fix. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS).
dryRunNoPreview what would be fixed without modifying any files. Recommended before the first real run.
forceNoAllow fixing files that have uncommitted git changes, or when the project is not a git repository. Without this flag regal refuses to touch uncommitted files.
configFileNoPath to a Regal config file (.regal/config.yaml).
disableNoDisable specific fix rules. Useful to skip directory-package-mismatch if you do not want files moved.
enableNoEnable specific fix rules.
disableCategoryNoDisable all rules in a category.
enableCategoryNoEnable all rules in a category.
ignoreFilesNoGlob patterns to exclude from fixing.
Behavior5/5

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

Annotations already mark destructiveHint=true and idempotentHint=true. The description adds significant context: mechanical fixes modify files, dryRun prevents changes, directory-package-mismatch moves files, and force overrides git safety. 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 highly concise: two sentences and a note, each sentence packed with meaningful information. It starts with the core action and lists rules, then provides critical usage tips. No wasted words.

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 9 parameters, annotations, and no output schema, the description covers the tool's purpose, side effects, safety measures, and prerequisite (regal). It does not describe the output format or error handling, but for an auto-fix tool the focus on behavior is adequate. Minor gap on return values.

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% with descriptive parameter descriptions. The description adds value beyond schema by explaining the five rules, the effect of directory-package-mismatch, and usage tips for dryRun and force. This enriches the agent's understanding without being redundant.

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 runs 'regal fix' to apply mechanical fixes for five specific rules, listing them explicitly. The verb 'run regal fix' and the resource 'Rego violations' are precise, and listing the five rules distinguishes it from sibling tools like rego_lint or rego_format.

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 provides clear usage guidance: recommends dryRun for preview, explains force for uncommitted files, warns about directory-package-mismatch moving files, and tells how to disable it. However, it does not explicitly contrast with siblings like rego_format_write or rego_migrate_v1, nor state when not to use this tool.

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