Skip to main content
Glama

get_decision_details

Read-only

Retrieve a PAST CodeRifts decision by exactly one identifier (case_id | decision_id | fingerprint): full report, breaking changes, scores, and linked receipt metadata if stored.

Use this when:

  • You have a decision_id (or fingerprint) from a previous preflight, PR comment, or CI log and need to inspect or explain that past decision.

  • You are auditing why a prior ALLOW/WARN/BLOCK was issued.

  • You are NOT requesting a new analysis of current before/after specs.

Do not use when:

  • You need a decision for the CURRENT uncommitted or PR head change set — call coderifts.preflight_change_set with the current artifacts.

  • You hold a receipt token and only need cryptographic/lifecycle verification — use coderifts.verify_receipt.

  • You have no identifier — run preflight first to create one.

Inputs: exactly one of case_id, decision_id, or fingerprint. {} → INVALID_INPUT; two identifiers → LOOKUP_IDENTIFIER_CONFLICT; case_id → CASE_NOT_FOUND (lookup never opens a case). Returns the stored document or not_found.

Scoping — fingerprint lookup returns only YOUR OWN decisions. A fingerprint is derived from content, not from an account, so two callers who preflight byte-identical specs derive the same one; the lookup is therefore constrained to the decisions your credential can prove it owns.

A decision that exists but is not yours returns the SAME not_found as one that was never issued. This is deliberate: a distinguishable "exists but forbidden" would confirm to any caller that a given content hash had been decided on by someone, which is the fact the scoping exists to withhold. Do not read not_found as proof that no such decision exists anywhere.

Decisions persisted without context.repository cannot currently be attributed to an account, and are not retrievable by fingerprint at all — not by their owner either. Retrieve those by decision_id, which is unchanged and unscoped. This is a limitation of what older stored rows carry, not a property of the lookup: rows written from now on record the account directly, so the gap narrows as older rows age out. If a fingerprint you expect returns not_found, use the decision_id before concluding the decision is missing.

When the stored envelope carries control fields, control_envelope.next_agent_step is structured remediation guidance the agent MAY follow for non-CONTINUE execution_action values (null on CONTINUE*). Still branch on execution_action; next_agent_step is a suggestion, not permission.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
case_idNoA case identifier. Lookup never opens a case. Until the case store exists this returns CASE_NOT_FOUND.
decision_idNoThe decision_id from a prior decision_result envelope. Provide exactly one identifier.
fingerprintNoA verdict fingerprint (sha256:...); returns the latest matching decision you own. Provide exactly one identifier.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
metaYes
decisionNo
evidenceNo
patternsNo
operationNo
timestampNo
risk_scoreNo
receipt_kindNo
chain_receiptNo
preflight_modeNo
safe_for_agentNo
decision_resultYesdecision-result.v1 envelope (control enums closed). Additive fields may appear and are not permission. Full schema: https://coderifts.com/schemas/decision-result.v1.consumer.json (producer: https://coderifts.com/schemas/decision-result.v1.producer.json).
pattern_sourcesNo
breaking_changesNo
control_envelopeNoControl envelope (control/1.0) derived from the stored decision_result. Includes next_agent_step (structured remediation SUGGESTION for non-CONTINUE execution_action; null on CONTINUE*; not permission — still branch on execution_action).
evidence_qualityNo
execution_actionNo
coderifts_versionNo
requires_migrationNo
verdict_fingerprintNo
required_action_coreNoBranchable required-action core { type, reason_code, recheck_required } when present on the envelope.
decision_spec_versionNo
decision_semantic_hashNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / description
      Added value: +"Closed exclusive identifier union: exactly one of case_id | decision_id | fingerprint. Encoded as minProperties=1 + maxProperties=1 + additionalProperties=false, NOT as a top-level oneOf/anyOf/allOf — Anthropic (and other strict tool APIs) reject those combinators at the root of input_schema and then refuse the entire tools array (measured: test/mcp-input-oneof-honesty.test.js, mcp-streamable.js comment). The server enforces the same mutex with named codes: empty {} → INVALID_INPUT; two or more identifiers → LOOKUP_IDENTIFIER_CONFLICT; case_id alone → CASE_NOT_FOUND (no case store yet; lookup never opens a case)."
    • addedInput schema / maxProperties
      Added value: +1
    • addedInput schema / properties / case_id
      Added value: +{
      +  "description": "A case identifier. Lookup never opens a case. Until the case store exists this returns CASE_NOT_FOUND.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / decision_id / description
      Previous value: -"The decision_id from a prior decision_result envelope. Provide this and/or fingerprint (at least one non-empty string required)."New value: +"The decision_id from a prior decision_result envelope. Provide exactly one identifier."
    • changedInput schema / properties / fingerprint / description
      Previous value: -"A verdict fingerprint (sha256:...); returns the latest matching decision. Provide this and/or decision_id (at least one non-empty string required)."New value: +"A verdict fingerprint (sha256:...); returns the latest matching decision you own. Provide exactly one identifier."
  2. Changed1 schema field changed
    • changedOutput schema / properties / decision_result / properties / blast_radius / description
      Previous value: -"ID27 additive COUNTS (not a score). Not permission."New value: +"Additive COUNTS (not a score). Not permission."
  3. Changed2 schema fields changed
    • changedOutput schema / properties / decision_result / properties / authority / description
      Previous value: -"ID963 additive. { audience, tenant_scope: bound|unbound, binding_proven_at? }. Informational — not permission, not a verify-receipt gate, not an ACL."New value: +"Additive. { audience, tenant_scope: bound|unbound, binding_proven_at? }. Informational — not permission, not a verify-receipt gate, not an ACL."
    • changedOutput schema / properties / decision_result / properties / derivation / description
      Previous value: -"ID637 6b additive. Present only when derivation:\"server\" produced this envelope. { source, platform?, base_sha, head_sha }. Covered by body_hash; not fingerprint."New value: +"Additive. Present only when derivation:\"server\" produced this envelope. { source, platform?, base_sha, head_sha }. Covered by body_hash; not fingerprint."
  4. Changed1 schema field changed
    • changedOutput schema / properties / decision_result / properties / derivation / description
      Previous value: -"ID637 6b additive. Present only when derivation:\"server\" produced this envelope. { source: github_compare, base_sha, head_sha }. Covered by body_hash; not fingerprint."New value: +"ID637 6b additive. Present only when derivation:\"server\" produced this envelope. { source, platform?, base_sha, head_sha }. Covered by body_hash; not fingerprint."
  5. Changed1 schema field changed
    • addedOutput schema / properties / decision_result / properties / derivation
      Added value: +{
      +  "description": "ID637 6b additive. Present only when derivation:\"server\" produced this envelope. { source: github_compare, base_sha, head_sha }. Covered by body_hash; not fingerprint.",
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
  6. Changed2 schema fields changed
    • addedOutput schema / properties / decision_result / properties / audience
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / decision_result / properties / authority
      Added value: +{
      +  "description": "ID963 additive. { audience, tenant_scope: bound|unbound, binding_proven_at? }. Informational — not permission, not a verify-receipt gate, not an ACL.",
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
  7. Changed1 schema field changed
    • addedOutput schema / properties / decision_result / properties / blast_radius
      Added value: +{
      +  "description": "ID27 additive COUNTS (not a score). Not permission.",
      +  "properties": {
      +    "consumers_declared": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "consumers_observed": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "endpoints": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "fields": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "graph_source": {
      +      "type": "string"
      +    },
      +    "params": {
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  8. Changed3 schema fields changed
    • addedOutput schema / properties / decision_result / additionalProperties
      Added value: +true
    • changedOutput schema / properties / decision_result / description
      Previous value: -"decision-result.v1 envelope (present when a chain receipt is available). Full schema: https://coderifts.com/schemas/decision-result.v1.consumer.json"New value: +"decision-result.v1 envelope (control enums closed). Additive fields may appear and are not permission. Full schema: https://coderifts.com/schemas/decision-result.v1.consumer.json (producer: https://coderifts.com/schemas/decision-result.v1.producer.json)."
    • addedOutput schema / properties / decision_result / properties
      Added value: +{
      +  "base": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "decision": {
      +    "enum": [
      +      "ALLOW",
      +      "WARN",
      +      "REQUIRE_APPROVAL",
      +      "BLOCK"
      +    ],
      +    "type": "string"
      +  },
      +  "decision_body_hash": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "decision_id": {
      +    "type": "string"
      +  },
      +  "environment": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "execution_action": {
      +    "enum": [
      +      "CONTINUE",
      +      "CONTINUE_WITH_MONITORING",
      +      "REQUEST_APPROVAL",
      +      "STOP"
      +    ],
      +    "type": "string"
      +  },
      +  "expires_at": {
      +    "type": "string"
      +  },
      +  "fingerprint": {
      +    "type": "string"
      +  },
      +  "head": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "input_fingerprint": {
      +    "type": "string"
      +  },
      +  "operation": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "receipt": {
      +    "type": "object"
      +  },
      +  "repository": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "safe_for_agent": {
      +    "type": "boolean"
      +  },
      +  "spec_version": {
      +    "pattern": "^decision-result\\.v1(\\.[0-9]+)?$",
      +    "type": "string"
      +  }
      +}
  9. Changed13 schema fields changed
    • addedOutput schema / properties / chain_receipt
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / coderifts_version
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / decision_semantic_hash
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / decision_spec_version
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / evidence
      Added value: +{
      +  "type": [
      +    "object",
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / evidence_quality
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / meta / properties / omitted_sections
      Added value: +{
      +  "type": "array"
      +}
    • addedOutput schema / properties / operation
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / pattern_sources
      Added value: +{
      +  "type": "array"
      +}
    • addedOutput schema / properties / preflight_mode
      Added value: +{
      +  "enum": [
      +    "analyze",
      +    "authorize"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / receipt_kind
      Added value: +{
      +  "enum": [
      +    "NONE",
      +    "operation_authorization"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / requires_migration
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / timestamp
      Added value: +{
      +  "type": "string"
      +}
  10. Changed1 schema field changed
    • changedOutput schema / properties / control_envelope / description
      Previous value: -"Control envelope (control/1.0) derived from the stored decision_result."New value: +"Control envelope (control/1.0) derived from the stored decision_result. Includes next_agent_step (structured remediation SUGGESTION for non-CONTINUE execution_action; null on CONTINUE*; not permission — still branch on execution_action)."
  11. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false; the description adds substantial behavioral detail beyond that. It explains fingerprint scoping (only your own decisions), the deliberate indistinguishability of 'exists but not yours' from 'never existed', the limitation on decisions without context.repository, and the meaning of control_envelope.next_agent_step. All of this is non-obvious operational behavior that an agent must know to interpret results correctly. No contradiction 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.

Conciseness4/5

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

The description is long, but it is well-structured with clear sections ('Use this when', 'Do not use when', 'Inputs', 'Scoping') and the core purpose is front-loaded in the first sentence. Every paragraph adds necessary nuance for a sensitive lookup tool. It could be marginally tightened (e.g., merging some sentences), but the structure earns a 4.

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?

The description covers all aspects an agent needs: what the tool does, when to use it, error behavior, scoping/privacy implications, handling of stale rows, and even guidance on how to interpret the returned envelope's next_agent_step. An output schema exists, so return-value structure is already defined, but the description adds behavioral expectations (not_found semantics) and disambiguation of edge cases. Nothing essential 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?

Although the input schema already has 100% coverage and detailed per-parameter descriptions, the tool description adds critical semantic context: the exact-mutex rule (exactly one identifier), the concrete error codes for each violation (INVALID_INPUT, LOOKUP_IDENTIFIER_CONFLICT, CASE_NOT_FOUND), and the nuanced behavior of fingerprint lookup (only yours, same not_found for others). This goes beyond the schema's structural description and provides actionable guidance on how to use the parameters and interpret edge cases.

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 opens with a concrete verb-resource statement: 'Retrieve a PAST CodeRifts decision by exactly one identifier (case_id | decision_id | fingerprint).' It specifies what the tool returns (full report, breaking changes, scores, receipt metadata) and immediately contrasts with siblings by naming preflight_change_set and verify_receipt in the 'Do not use' block. This leaves no ambiguity about what the tool does and how it differs from its neighbors.

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

Usage Guidelines5/5

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

The description explicitly enumerates three 'Use this when' scenarios and three 'Do not use when' scenarios, each naming the alternative tool and the condition that selects it (e.g., 'call coderifts.preflight_change_set' for current changes, 'coderifts.verify_receipt' for receipt verification). This is the highest clarity bar: an agent can decide without reading any other tool's schema.

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