Skip to main content
Glama
OrygnsCode

opa-mcp-server

Infer input schema

rego_infer_input_schema
Read-onlyIdempotent

Statically analyze Rego policies to generate JSON Schema of input fields, simplifying integration test writing and schema validation.

Instructions

Statically analyse one or more Rego policies and return a JSON Schema (draft-07) object describing every input.* field the policies read. Uses opa parse for AST-level analysis -- no running OPA server required. Correct starting point for writing integration tests, configuring opa check --schema validation, or documenting a policy API. Accepts inline source, individual files, or directories (walked recursively for *.rego files).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoInline Rego source to analyse. Mutually exclusive with paths.
pathsNoPolicy files or directories to analyse. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Directories are walked recursively for *.rego files.
Behavior4/5

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

Description adds value beyond annotations by explaining that the tool uses opa parse for AST-level analysis and requires no running OPA server. It also details how it handles input (inline source, files, directories recursively). Annotations already indicate read-only, idempotent behavior, and the description reinforces this without contradiction.

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 extremely concise: three sentences that front-load the primary function, then method, then use cases. No unnecessary words or repetition.

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?

The description covers the output format (JSON Schema draft-07), use cases, and input methods. Given the tool's moderate complexity and lack of an output schema in structured data, it provides sufficient completeness. Minor omissions (e.g., handling of edge cases) are acceptable.

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?

The input schema already covers parameter descriptions at 100% (source and paths with mutual exclusivity). The description rephrases some schema details but does not add significant new meaning beyond what the schema provides. The baseline of 3 is appropriate.

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 function: "Statically analyse one or more Rego policies and return a JSON Schema (draft-07) object describing every input.* field the policies read." It uses a specific verb (analyse) and resource (Rego policies), and distinguishes itself from sibling tools like rego_check or rego_eval by focusing on schema inference.

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 context: "Correct starting point for writing integration tests, configuring opa check --schema validation, or documenting a policy API." It does not explicitly state when not to use it or list alternatives, but the purpose and use cases are well-defined.

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