Skip to main content
Glama

WritersLogic agent-infra

policy-gate

Policy gate with a signed receipt: your JsonLogic rules vs a proposed tool call or payment — Evaluates your own policy (JsonLogic rules, each allow or deny, deny-overrides or first-match, default deny) against a proposed tool call, payment or action, and returns allow or deny, the rule id that decided, and a receipt signed by the hub over the hashes of the policy, the request and the decision. The receipt is the product: another agent or an auditor can verify offline which rule allowed th

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "policy": "<policy>",
      "request": "<request>"
    },
    "name": "policy-gate"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYesJsonLogic: { rules: [{ id, effect: allow|deny, when: <JsonLogic>, description? }] (at most 100), combining?: deny-overrides|first-match, defaultEffect?: deny|allow }. A string for cedar/rego.
requestYesThe proposed action as JSON (at most 65536 bytes), e.g. { tool, args, amountUsd, payee }. Rules read it with { "var": "args.amountUsd" }.
languageNoDefault jsonlogic. cedar and rego return unsupported.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses the decision output, rule attribution, deny-overrides/first-match combining, default deny, a 100-rule cap and 64KB request cap, and explains what the receipt signs (hashes of policy, request, decision) and why (offline auditor verification). It omits error behavior, whether any state is persisted, and the implications of the trailing truncation, so it is rich but not complete.

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

Conciseness3/5

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

The tagline 'Policy gate with a signed receipt' is well front-loaded, but the same scope is then restated twice ('vs a proposed tool call or payment' and 'against a proposed tool call, payment or action'), and the text ends mid-word ('which rule allowed th'), which leaves a visible structural defect. Tighter phrasing would preserve the strong receipt rationale without the duplication.

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?

For a policy-evaluation engine with receipts and no output schema, the description covers purpose, inputs, decision output, and receipt verification semantics well. Remaining gaps are failure modes and the truncated final sentence; a caller could invoke it correctly from this text plus the schema.

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 description coverage is 100%, so the schema already documents policy shape, request examples, and the language enum (including that cedar/rego return unsupported). The description restates the rule semantics (allow/deny, deny-overrides or first-match, default deny) and the action shape rather than adding new meaning, so it sits at the baseline.

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?

States a specific verb ('Evaluates') and resource ('your own policy (JsonLogic rules...)' against 'a proposed tool call, payment or action'), and spells out the exact return contract (allow/deny, deciding rule id, hub-signed receipt). The combination of JsonLogic rules plus a signed receipt makes it functionally distinguishable from a generic policy or gate tool.

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?

Gives clear context for use: you have a policy and a proposed action and want an allow/deny decision with a verifiable receipt. It names the input shapes ('proposed tool call, payment or action') but offers no explicit when-not guidance, no prerequisites (e.g. trust in the hub), and does not point to any alternative tool for policy evaluation without receipts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources