Skip to main content
Glama
ShadowGraph

ShadowGraph

Official

shadowgraph_record_attempt

Records one attempt with searchable solution and result details, commits a journal revision, and returns the stored record; idempotencyKey prevents duplicate retries.

Instructions

Record one attempt with its result; returns the stored attempt. Use shadowgraph_record_decision for a choice; shadowgraph_record_outcome updates an existing decision and its confidence. An attempt is a separate record. Appends an attempt and journal entry and commits a revision; idempotencyKey prevents duplicate retries. resultClass overrides wording-based failure classification.

Input Schema

NameRequiredDescriptionDefault
actorNoWho performed this write, such as an agent or person name. Stored for audit; never used to grant trust.
clientNoWhich client software performed this write, such as the host application name.
reasonNoWhy it turned out that way. Searchable content.
resultYesWhat happened. Required, non-empty, and searchable content. With no resultClass, wording such as failed, error, or regression is what places the attempt in shadowgraph_context failedAttempts; a captured attempt's wording is never read.
projectNoOwning project; required unless originId is set, else the write is refused.
originIdNoCapture-origin id; with no project the record belongs to it alone.
solutionYesWhat was tried. Required, non-empty, and searchable content.
sessionIdNoCaller-owned identifier that groups related writes in the audit trail.
environmentNoWhere it was tried, such as a runtime, OS, or version. Searchable content, so a later attempt can be matched to the same environment.
resultClassNoClassify the result instead of leaving it to the wording heuristic. Set it when the result text does not say failed, error, or regression, or when it does but the attempt did not fail.
sourceClassNoClaimed origin, never proof: agent_claimed (the default), tool_observed, human_confirmed, or production_verified. It weights confidence only. An unrecognised label downgrades to agent_claimed, kept verbatim in sourceRaw.
idempotencyKeyNoRetry identity within the project or origin and operation (also scope/type/key for memory). Reuse it to recover the original canonical ID; this key is never an entity ID.

Output Schema

NameRequiredDescriptionDefault
idYesStable entity identifier.
kindYesEntity kind: decision, attempt, memory, fact, relation, review, or alternative.
actorNoWho performed the write.
clientNoWhich client performed the write.
reasonNoWhy it turned out that way, verbatim as recorded.
resultNoWhat happened.
projectNoProject namespace; null for an unattributed record or one imported from before projects.
solutionNoWhat was tried.
createdAtNoISO 8601 creation time.
relatedToNoIdentifiers of related entities.
sessionIdNoSession identifier recorded with the write.
sourceRawNoThe original origin label when it differed from sourceClass. Audit only; never evidence.
updatedAtNoISO 8601 time of the last change.
causalClaimNoThe cause, attributed apart from the attempt: state recorded (the reason, agent_claimed), unknown, not_recorded, or legacy_freetext (a reason stored before causes were, never classed or evidenced).
environmentNoWhere it was tried.
resultClassNoDeclared or observed: failed, succeeded, or inconclusive. If absent: not captured (no captureRef or outcomeEvidence), the wording heuristic classifies; captured, the outcome is undetermined.
sourceClassNoClaimed origin class recorded with the write. A claim, never proof.
reusableWhenNoConditions recorded for reusing the attempt. All must hold, and none may be unresolved.
schemaVersionNoStorage schema version this entity was written under. A value above the build’s own version is preserved rather than downgraded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.42.1
    • addedInput schema / description
      Added value: +"ShadowGraph generates and returns canonical IDs. Supplying a creation id is refused before lookup or retry; keep returned IDs for later references."
    • addedInput schema / not
      Added value: +{
      +  "required": [
      +    "id"
      +  ]
      +}
    • changedInput schema / properties / idempotencyKey / description
      Previous value: -"Retry key scoped by project and operation: reuse it so a retry returns the first result instead of writing a duplicate. Without it every call creates a new entity."New value: +"Retry identity within the project or origin and operation (also scope/type/key for memory). Reuse it to recover the original canonical ID; this key is never an entity ID."
    • addedInput schema / properties / originId
      Added value: +{
      +  "description": "Capture-origin id; with no project the record belongs to it alone.",
      +  "type": "string"
      +}
    • changedInput schema / properties / project / description
      Previous value: -"Project namespace. Defaults to \"default\"; an empty string is rejected."New value: +"Owning project; required unless originId is set, else the write is refused."
    • changedInput schema / properties / result / description
      Previous value: -"What happened. Required, non-empty, and searchable content. Wording such as failed, error, or regression is what makes the attempt surface in shadowgraph_context as one to avoid."New value: +"What happened. Required, non-empty, and searchable content. With no resultClass, wording such as failed, error, or regression is what places the attempt in shadowgraph_context failedAttempts; a captured attempt's wording is never read."
    • addedInput schema / properties / resultClass
      Added value: +{
      +  "description": "Classify the result instead of leaving it to the wording heuristic. Set it when the result text does not say failed, error, or regression, or when it does but the attempt did not fail.",
      +  "enum": [
      +    "failed",
      +    "succeeded",
      +    "inconclusive"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / causalClaim
      Added value: +{
      +  "description": "The cause, attributed apart from the attempt: state recorded (the reason, agent_claimed), unknown, not_recorded, or legacy_freetext (a reason stored before causes were, never classed or evidenced).",
      +  "type": "object"
      +}
    • changedOutput schema / properties / project / description
      Previous value: -"Project namespace; records imported from a schema that predates projects may carry null."New value: +"Project namespace; null for an unattributed record or one imported from before projects."
    • changedOutput schema / properties / reason / description
      Previous value: -"Why it turned out that way."New value: +"Why it turned out that way, verbatim as recorded."
    • addedOutput schema / properties / resultClass
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Declared or observed: failed, succeeded, or inconclusive. If absent: not captured (no captureRef or outcomeEvidence), the wording heuristic classifies; captured, the outcome is undetermined."
      +}
    • changedOutput schema / properties / reusableWhen / description
      Previous value: -"Conditions under which the attempt is worth repeating."New value: +"Conditions recorded for reusing the attempt. All must hold, and none may be unresolved."
  2. Changed11 schema fields changedv0.40.1
    • changedInput schema / properties / actor / description
      Previous value: -"Who performed this write, e.g. an agent name."New value: +"Who performed this write, such as an agent or person name. Stored for audit; never used to grant trust."
    • changedInput schema / properties / client / description
      Previous value: -"Which client performed this write."New value: +"Which client software performed this write, such as the host application name."
    • addedInput schema / properties / environment / description
      Added value: +"Where it was tried, such as a runtime, OS, or version. Searchable content, so a later attempt can be matched to the same environment."
    • changedInput schema / properties / idempotencyKey / description
      Previous value: -"Retry key scoped by project and operation; reuse only for the same logical write."New value: +"Retry key scoped by project and operation: reuse it so a retry returns the first result instead of writing a duplicate. Without it every call creates a new entity."
    • addedInput schema / properties / project / description
      Added value: +"Project namespace. Defaults to \"default\"; an empty string is rejected."
    • addedInput schema / properties / reason / description
      Added value: +"Why it turned out that way. Searchable content."
    • addedInput schema / properties / result / description
      Added value: +"What happened. Required, non-empty, and searchable content. Wording such as failed, error, or regression is what makes the attempt surface in shadowgraph_context as one to avoid."
    • changedInput schema / properties / sessionId / description
      Previous value: -"Session identifier for this write."New value: +"Caller-owned identifier that groups related writes in the audit trail."
    • addedInput schema / properties / solution / description
      Added value: +"What was tried. Required, non-empty, and searchable content."
    • changedInput schema / properties / sourceClass / description
      Previous value: -"Claimed origin class. A claim, not proof: no value here can make a fact verified."New value: +"Claimed origin, never proof: agent_claimed (the default), tool_observed, human_confirmed, or production_verified. It weights confidence only. An unrecognised label downgrades to agent_claimed, kept verbatim in sourceRaw."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "A stored attempt and its result.",
      +  "properties": {
      +    "actor": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Who performed the write."
      +    },
      +    "client": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Which client performed the write."
      +    },
      +    "createdAt": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "ISO 8601 creation time."
      +    },
      +    "environment": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Where it was tried."
      +    },
      +    "id": {
      +      "description": "Stable entity identifier.",
      +      "type": "string"
      +    },
      +    "kind": {
      +      "description": "Entity kind: decision, attempt, memory, fact, relation, review, or alternative.",
      +      "type": "string"
      +    },
      +    "project": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Project namespace; records imported from a schema that predates projects may carry null."
      +    },
      +    "reason": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Why it turned out that way."
      +    },
      +    "relatedTo": {
      +      "description": "Identifiers of related entities.",
      +      "type": "array"
      +    },
      +    "result": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "What happened."
      +    },
      +    "reusableWhen": {
      +      "description": "Conditions under which the attempt is worth repeating.",
      +      "type": "array"
      +    },
      +    "schemaVersion": {
      +      "description": "Storage schema version this entity was written under. A value above the build’s own version is preserved rather than downgraded.",
      +      "type": "integer"
      +    },
      +    "sessionId": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Session identifier recorded with the write."
      +    },
      +    "solution": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "What was tried."
      +    },
      +    "sourceClass": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Claimed origin class recorded with the write. A claim, never proof."
      +    },
      +    "sourceRaw": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The original origin label when it differed from sourceClass. Audit only; never evidence."
      +    },
      +    "updatedAt": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "ISO 8601 time of the last change."
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "kind"
      +  ],
      +  "type": "object"
      +}
  3. First observedv0.40.0

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing side effects ('Appends an attempt and journal entry and commits a revision'), retry semantics via idempotencyKey, and that resultClass overrides the wording-based failure classifier that feeds shadowgraph_context failedAttempts. It does not address permissions, ordering, or what happens if the commit fails, and there is mild tension between idempotentHint=false and the claim that idempotencyKey prevents duplicate retries (the key is opt-in, so not a true contradiction).

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?

Four front-loaded sentences: purpose+return, sibling routing, side effects, then parameter notes. Every sentence carries information, though the clipped phrasing ('An attempt is a separate record.') reads more telegraphic than explanatory.

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?

With 12 parameters, an output schema, full annotation coverage and 100% schema description coverage, the description supplies what structured fields cannot: sibling routing and commit side effects. Remaining gaps are minor given the rich schema, though the interaction between a non-idempotent annotation and an optional idempotency key could have been spelled out.

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 already 100%, so the baseline is 3; the description still adds value by explaining that idempotencyKey guards duplicate retries and that resultClass bypasses the wording heuristic. It does not touch the required project/originId rule or sourceClass weighting, but those are documented in the schema.

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 and resource ('Record one attempt with its result'), states the return ('returns the stored attempt'), and explicitly distinguishes itself from shadowgraph_record_decision and shadowgraph_record_outcome. An agent can pick this tool without opening any schema.

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?

Names two alternative siblings and the condition that selects each ('for a choice' → record_decision; 'updates an existing decision and its confidence' → record_outcome), plus the clarifying rule 'An attempt is a separate record.' The routing decision is fully resolved in the description.

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