Skip to main content
Glama
ShadowGraph

ShadowGraph

Official

shadowgraph_record_fact

Destructive

Record an observed project fact by key with claimed provenance and optional validity window, superseding the active value and preserving history for decision rules.

Instructions

Record one observed fact as a project and key, with a claimed provenance class and optional validity window. Use for the fact keys reopenWhen rules name; shadowgraph_remember stores durable memory that is not an observation. Supersedes the previous active fact, keeping it as history. No input can make a fact verified. Each call commits a revision.

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": {
      "key": "<key>",
      "value": "<value>"
    },
    "name": "shadowgraph_record_fact"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesFact name, unique per project among active facts. Required and non-empty. Use the same key that a decision’s reopenWhen rules refer to.
tagsNoFree-form labels stored with the fact. Searchable content.
actorNoWho performed this write, such as an agent or person name. Stored for audit; never used to grant trust.
valueYesAny lossless JSON value: string, finite number, boolean, null, array, or object.
clientNoWhich client software performed this write, such as the host application name.
reasonNoExplanation or rationale for observing, updating, or superseding this fact.
sourceNoLegacy alias for sourceClass. An unknown label downgrades to agent_claimed with the raw label kept in sourceRaw.
projectNoOwning project; required unless originId is set, else the write is refused.
validToNoISO 8601 instant after which this fact stopped being true, or null.
backfillNoAlias for allowHistorical to insert a fact into past validity intervals.
originIdNoCapture-origin ID for unattributed records when project is omitted.
expiresAtNoISO 8601 instant after which shadowgraph_maintain expires this fact. Combined with validTo, the earlier boundary wins.
sessionIdNoCaller-owned identifier that groups related writes in the audit trail.
validFromNoISO 8601 instant from which this fact became true in the modeled world.
confidenceNoHow much the caller trusts this observation, 0-1. Defaults to 0.5. It does not verify anything.
observedAtNoISO 8601 timestamp when this fact was observed or measured. Defaults to now.
visibilityNoVisibility scope for cross-project recall and context: project (default) or global.
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.
changeSummaryNoSummary of what changed from the previous value of this fact.
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.
allowHistoricalNoPermit recording a historical fact with validFrom earlier than current active facts.
verificationStatusNoOnly "contradicted" may be set by a caller, because it lowers trust. "verified" and "expired" are rejected: verification is not self-assertable and expiry is owned by shadowgraph_maintain.

Output Schema

NameRequiredDescriptionDefault
idNoStable entity identifier.
keyYesFact name, unique per project among active facts.
kindNoEntity kind: decision, attempt, memory, fact, relation, review, or alternative.
tagsNoLabels or extracted keywords stored with the fact.
actorNoWho performed the write.
valueNoThe observed value, any lossless JSON value.
clientNoWhich client performed the write.
sourceNoLegacy alias of sourceClass, retained for compatibility.
statusNoactive, superseded, or expired.
projectNoProject namespace; null for an unattributed record or one imported from before projects.
temporalNoBi-temporal window: validFrom, validTo, recordedAt, invalidatedAt.
createdAtNoISO 8601 creation time.
expiresAtNoCaller-declared expiry instant, or null.
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.
confidenceNoCaller-declared confidence in the observation, 0-1.
observedAtNoISO 8601 time the fact was observed.
visibilityNoVisibility boundary: project or global.
sourceClassNoClaimed origin class recorded with the write. A claim, never proof.
verificationNoPresent only on a signed verification: the attestation this build checked.
changeSummaryNoSummary of modifications compared to superseded versions.
schemaVersionNoStorage schema version this entity was written under. A value above the build’s own version is preserved rather than downgraded.
validityPolicyNoDeclared expiry inputs and the effective expiration boundary derived from them.
verificationStatusNounverified, contradicted, expired, or verified. Only the separately configured signed-evidence verifier can produce verified.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv0.44.1
    • addedInput schema / properties / allowHistorical
      Added value: +{
      +  "description": "Permit recording a historical fact with validFrom earlier than current active facts.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / backfill
      Added value: +{
      +  "description": "Alias for allowHistorical to insert a fact into past validity intervals.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / changeSummary
      Added value: +{
      +  "description": "Summary of what changed from the previous value of this fact.",
      +  "type": "string"
      +}
    • addedInput schema / properties / observedAt
      Added value: +{
      +  "description": "ISO 8601 timestamp when this fact was observed or measured. Defaults to now.",
      +  "type": "string"
      +}
    • addedInput schema / properties / reason
      Added value: +{
      +  "description": "Explanation or rationale for observing, updating, or superseding this fact.",
      +  "type": "string"
      +}
    • addedInput schema / properties / tags
      Added value: +{
      +  "description": "Free-form labels stored with the fact. Searchable content.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / validFrom
      Added value: +{
      +  "description": "ISO 8601 instant from which this fact became true in the modeled world.",
      +  "type": "string"
      +}
    • addedInput schema / properties / validTo
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "ISO 8601 instant after which this fact stopped being true, or null."
      +}
    • addedInput schema / properties / visibility
      Added value: +{
      +  "description": "Visibility scope for cross-project recall and context: project (default) or global.",
      +  "enum": [
      +    "project",
      +    "global"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "key"
      -]New value: +[
      +  "key",
      +  "value"
      +]
    • addedOutput schema / properties / changeSummary
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Summary of modifications compared to superseded versions."
      +}
    • addedOutput schema / properties / tags
      Added value: +{
      +  "description": "Labels or extracted keywords stored with the fact.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / visibility
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Visibility boundary: project or global."
      +}
  2. 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."
  3. Changed6 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."
    • 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."
  4. Changed12 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 / confidence / description
      Added value: +"How much the caller trusts this observation, 0-1. Defaults to 0.5. It does not verify anything."
    • addedInput schema / properties / expiresAt / description
      Added value: +"ISO 8601 instant after which shadowgraph_maintain expires this fact. Combined with validTo, the earlier boundary wins."
    • 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 / key / description
      Added value: +"Fact name, unique per project among active facts. Required and non-empty. Use the same key that a decision’s reopenWhen rules refer to."
    • addedInput schema / properties / project / description
      Added value: +"Project namespace. Defaults to \"default\"; an empty string is rejected."
    • 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."
    • changedInput schema / properties / source / description
      Previous value: -"Legacy alias for sourceClass. Unknown labels downgrade to agent_claimed with the raw label kept in sourceRaw."New value: +"Legacy alias for sourceClass. An unknown label downgrades to agent_claimed with the raw label kept in sourceRaw."
    • 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."
    • changedInput schema / properties / verificationStatus / description
      Previous value: -"Only `contradicted` may be set by a caller; `verified` and `expired` are rejected."New value: +"Only \"contradicted\" may be set by a caller, because it lowers trust. \"verified\" and \"expired\" are rejected: verification is not self-assertable and expiry is owned by shadowgraph_maintain."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "A stored fact with its provenance claim and validity window.",
      +  "properties": {
      +    "actor": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Who performed the write."
      +    },
      +    "client": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Which client performed the write."
      +    },
      +    "confidence": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Caller-declared confidence in the observation, 0-1."
      +    },
      +    "createdAt": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "ISO 8601 creation time."
      +    },
      +    "expiresAt": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Caller-declared expiry instant, or null."
      +    },
      +    "id": {
      +      "description": "Stable entity identifier.",
      +      "type": "string"
      +    },
      +    "key": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Fact name, unique per project among active facts."
      +    },
      +    "kind": {
      +      "description": "Entity kind: decision, attempt, memory, fact, relation, review, or alternative.",
      +      "type": "string"
      +    },
      +    "observedAt": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "ISO 8601 time the fact was observed."
      +    },
      +    "project": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Project namespace; records imported from a schema that predates projects may carry null."
      +    },
      +    "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."
      +    },
      +    "source": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Legacy alias of sourceClass, retained for compatibility."
      +    },
      +    "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."
      +    },
      +    "status": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "active, superseded, or expired."
      +    },
      +    "temporal": {
      +      "description": "Bi-temporal window: validFrom, validTo, recordedAt, invalidatedAt.",
      +      "type": "object"
      +    },
      +    "updatedAt": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "ISO 8601 time of the last change."
      +    },
      +    "validityPolicy": {
      +      "description": "Declared expiry inputs and the effective expiration boundary derived from them.",
      +      "type": "object"
      +    },
      +    "value": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        },
      +        {
      +          "type": "array"
      +        },
      +        {
      +          "type": "object"
      +        }
      +      ],
      +      "description": "The observed value, any lossless JSON value."
      +    },
      +    "verification": {
      +      "description": "Present only on a signed verification: the attestation this build checked.",
      +      "type": "object"
      +    },
      +    "verificationStatus": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "unverified, contradicted, expired, or verified. Only the separately configured signed-evidence verifier can produce verified."
      +    }
      +  },
      +  "required": [
      +    "key"
      +  ],
      +  "type": "object"
      +}
  5. First observedv0.40.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, the description states exactly what the destructiveHint destroys and what survives ("Supersedes the previous active fact, keeping it as history"), discloses that every call writes a revision, and warns that no input can make a fact verified. That is precisely the mutation and trust semantics an agent needs and that the boolean hints alone cannot convey.

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?

Five short sentences, each carrying distinct information: purpose, sibling routing, supersession, trust cap, and write granularity. Purpose is front-loaded and nothing is repeated.

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 an output schema present and annotations covering the safety profile, the description covers the important gaps: sibling routing, supersession/history retention, and the verification ceiling. It does not mention idempotency or retry recovery, but the schema's idempotencyKey description and the schema-level note about canonical IDs already handle that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already carries parameter meaning, which sets the baseline at 3. The description gestures at the shape of the payload (project and key, claimed provenance class, optional validity window) but adds no syntax, defaults, or constraints beyond what the schema documents.

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 opening sentence gives a specific verb and resource ("Record one observed fact") plus the addressing model (project and key), provenance class, and validity window. It then explicitly distinguishes itself from shadowgraph_remember and states the supersession behavior, so an agent can separate this from record_decision, record_attempt, and remember 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?

It names the alternative tool explicitly ("shadowgraph_remember stores durable memory that is not an observation") and gives a usage condition ("fact keys reopenWhen rules name"). It does not differentiate against the other record_* siblings such as record_decision or record_attempt, so the routing guidance is clear but not exhaustive.

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