Skip to main content
Glama

writ_policy_env

Read or set an environment's sparse policy override (dev, staging, or prod) to change which verbs are allowed, denied, require a grant, or need step-up. Returns effective policy and provenance.

Instructions

Read or set one environment's sparse policy override (dev, staging, or prod).

With policy empty: GET the override. Returns the gate payload verbatim - the sparse override in policy (only the verbs it explicitly sets; empty with version 0 when never configured), effectivePolicy (the tenant default with the override applied on top, which is what checks naming this environment evaluate against), and policyProvenance naming the winning layer (tenant or environment) per verb.

With policy given: PUT the override. Pass a JSON object string of verb to mode, e.g. '{"refund": "allow"}'. Modes: allow, deny, require_grant, step_up. The override is sparse: only the verbs you send are stored; every other verb keeps inheriting the tenant default. Every successful update bumps the override's version by one; the tenant default's version is untouched. To relax a verb in one environment, set it to "allow".

Args: environment: dev, staging, or prod. Validated client-side; anything else returns an error JSON without calling the gate. policy: JSON object string of verbs to modes, e.g. '{"refund": "allow"}'. Empty string (default) reads instead. Bad JSON, unknown verbs, or unknown modes return an error JSON without calling the gate.

Returns the gate payload verbatim on success; on failure an error JSON with error, status, and detail.

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": {
      "environment": "<environment>"
    },
    "name": "writ_policy_env"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyNo
environmentYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.28

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: it discloses sparsity (only sent verbs are stored, others keep inheriting), version bumping on the override only with the tenant version untouched, client-side validation that short-circuits before the gate is called, and the exact error shape (error, status, detail). It also explains what effectivePolicy and policyProvenance mean in the returned payload.

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 front-loaded with the read/write switch and then cleanly sectioned into read mode, write mode, args, and returns. Word economy is slightly loose — 'sparse' and the inherit-from-tenant idea are restated several times — and the return summary partially duplicates the existing output schema.

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?

For a two-parameter dual-mode mutation/read tool with no annotations, the definition covers mode selection, validation failure paths, sparsity semantics, versioning side effects, and payload contents. Nothing an agent needs in order to invoke it safely or interpret the result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does: environment is enumerated as dev/staging/prod with its validation behavior, and policy is defined as a JSON object string of verb to mode with a literal example, the default empty-string read behavior, and the three failure cases (bad JSON, unknown verbs, unknown modes).

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 first sentence gives a specific verb pair and resource: 'Read or set one environment's sparse policy override (dev, staging, or prod).' The repeated contrast with 'the tenant default' makes the scope unmistakable versus the tenant-level sibling writ_policy, so an agent can route correctly without opening the schema.

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?

It explicitly states the mode-selection rule: empty policy performs a GET, a supplied policy performs a PUT, plus a concrete scenario ('To relax a verb in one environment, set it to "allow"'). It stops short of naming the tenant-default sibling as the alternative to use instead when the change should apply everywhere, and gives no explicit when-not conditions.

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