Skip to main content
Glama
OrygnsCode

opa-mcp-server

Migrate Rego to v1 syntax

rego_migrate_v1
Read-onlyIdempotent

Migrates Rego v0 policies to v1 syntax by auto-fixing reserved keywords and adding import rego.v1, then validates and reports any manual fixes needed.

Instructions

Migrate Rego v0 source to Rego v1 syntax in two phases: (1) opa fmt --rego-v1 auto-fixes reserved keywords (if, contains, every, in in rule heads) and adds import rego.v1; (2) opa check --v1-compatible validates the migrated source and reports any remaining issues that cannot be auto-fixed (e.g. removed builtins, semantic conflicts). Returns the migrated source and a changed flag even when check finds remaining errors -- this lets you inspect what changed and fix the remainder manually. If the source is completely unparseable, returns INVALID_REGO.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesRego v0 source to migrate to Rego v1 syntax. `opa fmt --rego-v1` auto-fixes reserved keywords and adds `import rego.v1`; any remaining issues are returned in `errors` so you can resolve them manually.
Behavior5/5

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

The description adds significant detail beyond annotations: two-phase process, return of migrated source and changed flag even on errors, and special INVALID_REGO return for unparseable input. 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 concise (three sentences), front-loads the main action, and each sentence adds essential information with no redundancy.

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 lacking an output schema, the description fully explains return values (migrated source, changed flag, INVALID_REGO) and error conditions, making the tool's behavior complete for agent usage.

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% and the parameter description in the schema is thorough, explaining the migration process and error handling, adding value beyond type and constraints.

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 'Migrate' and resource 'Rego to v1 syntax', and details a two-phase process. It clearly distinguishes from siblings like rego_fix by focusing on v1 migration.

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 explains when to use (to migrate v0 to v1) and what to do with remaining issues, but does not explicitly state when not to use or compare to alternatives among siblings.

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