Skip to main content
Glama

log_decision

Persist decisions to an immutable audit trail, linking them to simulation runs for later outcome tracking and prediction accuracy measurement.

Instructions

Persist a decision to the Decision Memory audit trail. Link to a simulation run_id to bind the full DecisionPlan context. Call record_outcome later to close the feedback loop and measure prediction accuracy. Every logged decision is immutably hashed — no tampering possible. Returns decision_id, chosen_action, expected_value, confidence, and created_at.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idNoSimulation run_id that produced this decision (from simulate or recommend).
contextNoBusiness context — what was the situation when this decision was made?
risk_p5No5th-percentile downside at decision time.
risk_p95No95th-percentile upside at decision time.
risk_polNoProbability of loss (0–1) at decision time.
rationaleNoExplanation of why this option was chosen.
confidenceNoConfidence score (0–1) from the simulation.
result_hashNoSHA-256 output fingerprint from the simulation.
request_hashNoSHA-256 input fingerprint from the simulation.
chosen_actionYesThe action that was decided upon.
expected_valueNoExpected outcome value at decision time.
options_consideredNoAll option names that were evaluated.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations are minimal (no readOnly or idempotent hints), so the description carries the burden. It discloses that logging is immutable and hashed, and lists the return fields, providing meaningful behavioral context beyond the schema. No contradictions with annotations.

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?

Three sentences with no fluff. The first sentence states the core purpose, the second gives lifecycle guidance, and the third covers immutability and return fields. Efficient and front-loaded.

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 write operation with 12 parameters fully described in the schema, the description covers purpose, lifecycle, immutability, and return values. It lacks explicit error/permission notes, but that is not critical for typical usage. Overall, it is complete enough for an agent to call correctly.

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 baseline is 3. The description adds extra meaning by explaining that run_id binds the full DecisionPlan context, which goes beyond the schema's 'Simulation run_id that produced this decision.' This justifies a 4.

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 states a specific verb ('persist') and resource ('decision to the Decision Memory audit trail'), clearly distinguishing it from related tools like execute_decision or plan_decision. It also mentions the return fields, further clarifying its role.

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 context: use this to persist a decision and link it to a simulation run_id. It also references record_outcome for later feedback, implying when to use this versus that. However, it does not explicitly contrast with other decision-related siblings like execute_decision or plan_decision.

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

Deploy Server

Other Tools