Skip to main content
Glama

record_decision

Records one validated judgment call in a plan's hash-chained decision stream for auditable tracking, returning a decision ID or refusal code.

Instructions

Record one judgment call in plan_name's hash-chained stream.

Authorizes decision:record on the plan first (a plan the caller may not see is refused exactly as a plan that does not exist is), then validates the ruling, the rationale, the evidence, the decision class and the story key, then applies the per-principal rate limit, then appends one record and writes one audit record.

Refusals never raise and return {"recorded": false, "error": <code>} with one of not_authorized, empty_ruling, empty_rationale, empty_evidence, invalid_decision_class, unknown_story, rate_limited (plus retry_after_seconds) or record_refused (the v2 validator refused a record that passed the checks above -- defence in depth, never expected).

Success returns {"recorded": true, "decision_id": <32 hex>, "seq": <int>}.

The record: tier follows the bound principal (human for a human, auto for an agent -- the v2 chain refuses tier="human" from a non-human principal, so "always human" would be misattribution); the caller's identity is stamped from the bound principal (S2) and never from an argument, so an actor argument is ignored; rule carries empty layer, persona and policy shas and PIPELINE_RECORD_DECISION_MODEL (or "unspecified"); alternatives carries the rationale as its single element "rationale: <text>" (an alternatives entry is capped at 200 characters, so the text keeps 189 of them -- a dedicated rationale field is a later S3 revision); outcome is empty. The question is accepted and not persisted: the v2 record has no field for it.

Rate limiting: PIPELINE_RECORD_DECISION_PER_MINUTE calls per minute per principal subject, default 30; a malformed or non-positive value means 30. The window is in-process memory, so it resets when the process restarts and is not shared between processes.

Attribution under the shared-secret provider: the caller resolves to LOCAL_OPERATOR, so a record cannot tell an agent session from a human one. Agent attribution needs the OIDC identity seam (S2).

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": {
      "plan_name": "<plan_name>",
      "story_key": "<story_key>",
      "decision_class": "<decision_class>",
      "question": "<question>",
      "ruling": "<ruling>",
      "rationale": "<rationale>",
      "evidence": "<evidence>",
      "ignored": "<ignored>"
    },
    "name": "record_decision"
  }
}

Input Schema

NameRequiredDescriptionDefault
rulingYes
ignoredYes
evidenceYes
questionYes
plan_nameYes
rationaleYes
story_keyYes
reversibleNo
decision_classYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.10.0

TDQS

A4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so extensively: authorization semantics (an invisible plan is refused exactly like a nonexistent one), the validation order, per-principal rate limiting with env-var override, default, malformed-value fallback, and the in-process window resetting on restart. It also enumerates every refusal code, states refusals never raise, and discloses field-mapping quirks (tier follows the bound principal, an actor argument is ignored, question is accepted but not persisted, rationale is squeezed into a 189-character alternatives entry).

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?

Front-loaded with the action, then the internal flow, then refusal/success shapes, then record mapping and rate limits — a sensible order for a dense tool. Some asides are engineering archaeology rather than caller-relevant ('a dedicated rationale field is a later S3 revision', the 'always human would be misattribution' parenthetical), adding length without changing how the agent invokes the tool.

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 high-complexity, nine-parameter mutation tool with no annotations, the description covers authorization, validation, rate limits, failure modes and persistence quirks thoroughly; the output schema covers return values. Remaining gaps are modest: no sibling routing guidance and no semantics for 'reversible'.

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 description coverage is 0%, so the description must compensate, and it largely does: it explains that ruling, rationale, evidence, decision_class and story_key are validated with specific error codes, that question is accepted and discarded, and that caller identity comes from the bound principal rather than any argument. It leaves gaps: the 'reversible' parameter and its default are never mentioned, and the valid decision_class values are not enumerated despite invalid_decision_class existing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and resource: 'Record one judgment call in ``plan_name``'s hash-chained stream.' That is unambiguous and an agent can tell it apart from request_decision or list_decisions by the 'record one judgment call' framing, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by 'record one judgment call' plus the precondition sequence (authorize, validate, rate limit, append). There is no explicit statement of when to use this instead of request_decision, nor any exclusion or prerequisite guidance for the caller beyond the internal flow.

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