Skip to main content
Glama

Share Rego policy as a GitHub Gist

rego_playground_share

Publish Rego policies as public GitHub Gists to share with teammates or create reproducible examples. Include query, input, or data to bundle evaluation context for OPA or Conftest.

Instructions

Share a Rego policy with teammates or create a reproducible example by publishing it as a public GitHub Gist. Returns { gistUrl, rawPolicyUrl, id }: the gistUrl renders the policy with syntax highlighting on github.com; the rawPolicyUrl can be passed directly to OPA (opa eval -d <rawPolicyUrl> <query>) or used as a data source in Conftest. When query, input, or data are supplied, a metadata.json file is bundled into the Gist so recipients have the full evaluation context to reproduce results. Each call creates a new Gist -- use the returned id to reference it later. Requires GITHUB_TOKEN in the environment (GitHub personal access token with the "gist" scope); returns GITHUB_TOKEN_MISSING with setup instructions if unset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policyYesRego source code to share (the contents of a .rego file).
queryNoDefault query to evaluate against the policy, e.g. "data.authz.allow". Stored in metadata.json alongside the policy file.
inputNoInput document as a JSON string. Stored in metadata.json alongside the policy file.
dataNoData document as a JSON string. Stored in metadata.json alongside the policy file.
descriptionNoShort description for the Gist (shown on github.com/gists).
Behavior5/5

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

The description discloses that each call creates a new Gist (non-idempotent), requires GITHUB_TOKEN with 'gist' scope, and explains the return values. Annotations provide readOnlyHint=false and destructiveHint=false, which are consistent with creating external resources. The description adds crucial behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a moderate-length paragraph that front-loads the purpose and then provides supporting details. Every sentence contributes useful information (return format, usage with OPA, metadata bundling, authentication). It could be slightly more concise but remains clear and well-structured.

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?

Given the tool's complexity (5 parameters, 1 required, no output schema), the description effectively covers invocation, return values, authentication requirements, and how to use the results. It provides sufficient context for correct tool selection and usage without relying on additional documentation.

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%, so the schema already documents each parameter. However, the description adds value by explaining that query, input, and data are bundled into metadata.json for reproducibility, and that rawPolicyUrl can be used directly with OPA or Conftest. This enhances practical understanding 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 clearly states the tool's purpose: sharing a Rego policy as a public GitHub Gist for team collaboration or reproducible examples. It distinguishes itself from sibling tools (like rego_eval or rego_test) by focusing on sharing rather than evaluation or testing.

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 the tool (share policy, create reproducible example) and provides context for optional parameters (query, input, data bundle into metadata.json). It also notes the prerequisite GITHUB_TOKEN and what happens if missing. However, it does not explicitly state when not to use it or compare directly to alternatives.

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