Skip to main content
Glama
ShadowGraph

ShadowGraph

Official

shadowgraph_record_attempt

Record one solution attempt with its result and optional context, then return the stored record; link it to a related decision and use an idempotency key to deduplicate retries.

Instructions

Record one attempt with its solution and result, returning the stored attempt. Link relatedTo to an existing decision. shadowgraph_record_decision records choices, shadowgraph_record_outcome updates one, shadowgraph_record_fact records facts. Appends an attempt and journal entry and commits a revision; idempotencyKey deduplicates retries (conflicts error); resultClass overrides wording.

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": {
      "solution": "<solution>",
      "result": "<result>"
    },
    "name": "shadowgraph_record_attempt"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoFree-form labels stored with the attempt. Searchable content.
taskNoTask or problem context this attempt was trying to solve. Searchable content.
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. When resultClass is omitted, words such as failed, error, or regression surface 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 for unattributed records when project is omitted.
solutionYesWhat was tried. Required, non-empty, and searchable content.
relatedToNoIdentifiers of related entities such as decisions or other attempts.
sessionIdNoCaller-owned identifier that groups related writes in the audit trail.
visibilityNoVisibility scope for cross-project recall and context: project (default) or global.
environmentNoWhere it was tried, such as a runtime, OS, or version. Searchable content, so a later attempt can be matched to the same environment.
resultClassNoOptional classification: failed, succeeded, or inconclusive. Overrides wording-based failure detection when provided.
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.
reusableWhenNoConditions for reusing this attempt: legacy keys, symbolic strings, or structured rules using stored facts and key/value or target/expected aliases. Symbolic operators: >=, <=, ==, !=, >, <. All must hold; unresolved conditions block reuse.
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.
tagsNoLabels or extracted keywords stored with the attempt.
taskNoTask or problem context this attempt was trying to solve.
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.
visibilityNoVisibility boundary: project or global.
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. Changed3 schema fields changedv0.44.4
    • changedInput schema / properties / result / description
      Previous value: -"What happened. Required, non-empty, and searchable content. Only legacy/core records without resultClass use wording such as failed, error, or regression to surface in shadowgraph_context failedAttempts; a captured attempt's wording is never read."New value: +"What happened. Required, non-empty, and searchable content. When resultClass is omitted, words such as failed, error, or regression surface the attempt in shadowgraph_context failedAttempts; a captured attempt's wording is never read."
    • changedInput schema / properties / resultClass / description
      Previous value: -"Required for new MCP writes. Classify the result explicitly instead of leaving it to the legacy wording heuristic."New value: +"Optional classification: failed, succeeded, or inconclusive. Overrides wording-based failure detection when provided."
    • changedInput schema / required
      Previous value: -[
      -  "solution",
      -  "result",
      -  "resultClass"
      -]New value: +[
      +  "solution",
      +  "result"
      +]
  2. Changed6 schema fields changedv0.44.3
    • addedInput schema / $defs
      Added value: +{
      +  "jsonValue": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "type": "boolean"
      +      },
      +      {
      +        "type": "null"
      +      },
      +      {
      +        "items": {
      +          "$ref": "#/$defs/jsonValue"
      +        },
      +        "type": "array"
      +      },
      +      {
      +        "additionalProperties": {
      +          "$ref": "#/$defs/jsonValue"
      +        },
      +        "type": "object"
      +      }
      +    ],
      +    "description": "Any lossless JSON value: string, finite number, boolean, null, array, or object."
      +  }
      +}
    • changedInput schema / properties / result / description
      Previous 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."New value: +"What happened. Required, non-empty, and searchable content. Only legacy/core records without resultClass use wording such as failed, error, or regression to surface in shadowgraph_context failedAttempts; a captured attempt's wording is never read."
    • changedInput schema / properties / resultClass / description
      Previous value: -"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."New value: +"Required for new MCP writes. Classify the result explicitly instead of leaving it to the legacy wording heuristic."
    • changedInput schema / properties / reusableWhen / description
      Previous value: -"Conditions for reusing this attempt: plain keys, symbolic strings (\"key >= value\"), or rule objects { key, operator, value } (accepts target/expected aliases) with symbolic operators (>=, <=, ==, !=, >, <) or words."New value: +"Conditions for reusing this attempt: legacy keys, symbolic strings, or structured rules using stored facts and key/value or target/expected aliases. Symbolic operators: >=, <=, ==, !=, >, <. All must hold; unresolved conditions block reuse."
    • addedInput schema / properties / reusableWhen / items
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "A legacy changedFacts key or symbolic condition such as \"key >= value\".",
      +      "type": "string"
      +    },
      +    {
      +      "anyOf": [
      +        {
      +          "required": [
      +            "key",
      +            "value"
      +          ]
      +        },
      +        {
      +          "required": [
      +            "key",
      +            "expected"
      +          ]
      +        },
      +        {
      +          "required": [
      +            "target",
      +            "value"
      +          ]
      +        },
      +        {
      +          "required": [
      +            "target",
      +            "expected"
      +          ]
      +        }
      +      ],
      +      "properties": {
      +        "expected": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "boolean"
      +            },
      +            {
      +              "type": "null"
      +            },
      +            {
      +              "items": {
      +                "$ref": "#/$defs/jsonValue"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "additionalProperties": {
      +                "$ref": "#/$defs/jsonValue"
      +              },
      +              "type": "object"
      +            }
      +          ],
      +          "description": "Alias for value; conflicting value and expected operands are rejected."
      +        },
      +        "key": {
      +          "description": "Stored fact key to evaluate; use key or its target alias.",
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "operator": {
      +          "description": "Comparison to apply, as a supported word or symbolic alias. Defaults to equals.",
      +          "enum": [
      +            "equals",
      +            "not_equals",
      +            "contains",
      +            "greater_than",
      +            "less_than",
      +            "gte",
      +            "lte",
      +            "between",
      +            "in",
      +            "not_in",
      +            ">=",
      +            "<=",
      +            "==",
      +            "===",
      +            "=",
      +            "!=",
      +            "!==",
      +            "<>",
      +            ">",
      +            "<"
      +          ],
      +          "type": "string"
      +        },
      +        "target": {
      +          "description": "Alias for key; conflicting key and target values are rejected.",
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "unit": {
      +          "description": "Optional comparison unit.",
      +          "enum": [
      +            "ms",
      +            "s",
      +            "sec",
      +            "min",
      +            "h",
      +            "hr",
      +            "d",
      +            "%",
      +            "pct"
      +          ],
      +          "type": "string"
      +        },
      +        "value": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "boolean"
      +            },
      +            {
      +              "type": "null"
      +            },
      +            {
      +              "items": {
      +                "$ref": "#/$defs/jsonValue"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "additionalProperties": {
      +                "$ref": "#/$defs/jsonValue"
      +              },
      +              "type": "object"
      +            }
      +          ],
      +          "description": "Expected operand; use value or its expected alias. Null, false, zero, and empty string are explicit values."
      +        }
      +      },
      +      "type": "object"
      +    }
      +  ]
      +}
    • changedInput schema / required
      Previous value: -[
      -  "solution",
      -  "result"
      -]New value: +[
      +  "solution",
      +  "result",
      +  "resultClass"
      +]
  3. Changed8 schema fields changedv0.44.1
    • addedInput schema / properties / relatedTo
      Added value: +{
      +  "description": "Identifiers of related entities such as decisions or other attempts.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / reusableWhen
      Added value: +{
      +  "description": "Conditions for reusing this attempt: plain keys, symbolic strings (\"key >= value\"), or rule objects { key, operator, value } (accepts target/expected aliases) with symbolic operators (>=, <=, ==, !=, >, <) or words.",
      +  "type": "array"
      +}
    • addedInput schema / properties / tags
      Added value: +{
      +  "description": "Free-form labels stored with the attempt. Searchable content.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / task
      Added value: +{
      +  "description": "Task or problem context this attempt was trying to solve. Searchable content.",
      +  "type": "string"
      +}
    • addedInput schema / properties / visibility
      Added value: +{
      +  "description": "Visibility scope for cross-project recall and context: project (default) or global.",
      +  "enum": [
      +    "project",
      +    "global"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / tags
      Added value: +{
      +  "description": "Labels or extracted keywords stored with the attempt.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / task
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Task or problem context this attempt was trying to solve."
      +}
    • addedOutput schema / properties / visibility
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Visibility boundary: project or global."
      +}
  4. Changed1 schema field changedv0.43.6
    • changedInput schema / properties / originId / description
      Previous value: -"Capture-origin id; with no project the record belongs to it alone."New value: +"Capture-origin ID for unattributed records when project is omitted."
  5. 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."
  6. 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"
      +}
  7. First observedv0.40.0

TDQS

A4.3/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the write footprint ('Appends an attempt and journal entry and commits a revision'), retry semantics ('idempotencyKey deduplicates retries (conflicts error)'), and the resultClass override of failure-wording detection. One nuance is left under-specified: idempotentHint=false while the description advertises idempotencyKey-based dedup — a reader can infer the key is opt-in and no-key retries duplicate, but it isn't said outright, so this is not a contradiction, just a missing clarification.

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 core action and return value, then alternatives, then side effects — a sensible ordering with no filler. The final clause chain ('Appends... and commits...; idempotencyKey...; resultClass...') is dense and run-on, which slightly hurts scannability.

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 17-parameter mutation with annotations and an output schema present, the description covers the things structured fields cannot: routing between sibling record tools, write side effects, and retry/conflict behavior. It omits the project-vs-originId requirement and the id-refusal rule, but both are documented in the schema, so nothing critical is missing.

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 100%, so the baseline is 3, but the description adds real meaning on top: the linking intent of relatedTo, the dedup-and-conflict behavior of idempotencyKey, and the fact that resultClass overrides wording-based classification. Coverage of the remaining 14 parameters is left entirely to the schema, which is acceptable given its richness.

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+resource ('Record one attempt with its solution and result') plus the return behavior ('returning the stored attempt'), and then names the three sibling record tools with what each does instead, so an agent can distinguish it 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 Guidelines4/5

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

Explicitly routes between the four record_* tools by stating what the alternatives do ('records choices', 'updates one', 'records facts') and adds a usage hint for relatedTo ('Link relatedTo to an existing decision'). It stops short of stating when NOT to use this tool or any preconditions for choosing it over e.g. record_outcome, so the selection conditions remain implicit.

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