Skip to main content
Glama
ShadowGraph

ShadowGraph

Official

shadowgraph_validate

Diagnose record, graph, and journal integrity without applying repairs, so you can check consistency before deciding on maintenance or repair actions.

Instructions

Diagnose record, graph and journal integrity without applying repairs. shadowgraph_maintain ages records; shadowgraph_review checks decision rules; shadowgraph_repair_plan (full mode only) proposes repairs; shadowgraph_rebuild (full mode only) checks journal replay. Own-scope read saves nothing; an access key commits a revision and audit. For full-mode tools, ask the operator to unset SHADOWGRAPH_MCP_PROFILE and restart with SHADOWGRAPH_MCP_COMPACT=0.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "shadowgraph_validate"
  }
}

Input Schema

NameRequiredDescriptionDefault
grantIdNoAlias for accessId; conflicting identifiers are refused.
projectNoProject or confirmed workspace binding; otherwise origin-only. No identity returns an empty scoped view.
accessIdNoGrant ID, rechecked at use. Widens reads only, never write authority. Presenting it commits a revision and bounded audit (at most one aggregate per grant, surface, outcome and UTC day). Conflicts with grantId are refused.
originIdNoCapture-origin ID for unattributed records when project is omitted.

Output Schema

NameRequiredDescriptionDefault
validYesFalse when any error or unsupported issue is present.
countsYesIssue counts per severity.
issuesYesEvery diagnostic found, each with a stable code and severity.
readProvenanceNoOriginal read bounds; reuse intersects these with currently valid authority.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.43.6
    • changedInput schema / properties / accessId / description
      Previous value: -"Grant ID, rechecked at use. Widens reads only, never write authority. Presenting an access key commits a revision and bounded operational audit: at most one aggregate per grant, surface, outcome and UTC day. Conflicts with a different grantId are refused."New value: +"Grant ID, rechecked at use. Widens reads only, never write authority. Presenting it commits a revision and bounded audit (at most one aggregate per grant, surface, outcome and UTC day). Conflicts with grantId are refused."
    • 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."
  2. Changed1 schema field changedv0.42.2
    • changedInput schema / properties / accessId / description
      Previous value: -"Grant ID, rechecked at use."New value: +"Grant ID, rechecked at use. Widens reads only, never write authority. Presenting an access key commits a revision and bounded operational audit: at most one aggregate per grant, surface, outcome and UTC day. Conflicts with a different grantId are refused."
  3. Changed2 schema fields changedv0.42.1
    • addedInput schema / properties
      Added value: +{
      +  "accessId": {
      +    "description": "Grant ID, rechecked at use.",
      +    "type": "string"
      +  },
      +  "grantId": {
      +    "description": "Alias for accessId; conflicting identifiers are refused.",
      +    "type": "string"
      +  },
      +  "originId": {
      +    "description": "Capture-origin id; with no project the record belongs to it alone.",
      +    "type": "string"
      +  },
      +  "project": {
      +    "description": "Project or confirmed workspace binding; otherwise origin-only. No identity returns an empty scoped view.",
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / readProvenance
      Added value: +{
      +  "description": "Original read bounds; reuse intersects these with currently valid authority.",
      +  "properties": {
      +    "accessId": {
      +      "description": "Original grant, revalidated on every reuse.",
      +      "type": "string"
      +    },
      +    "expiresAt": {
      +      "description": "Original effective expiry; reuse cannot extend it.",
      +      "type": "string"
      +    },
      +    "request": {
      +      "description": "Original request ownership, preserved during expansion.",
      +      "properties": {
      +        "originId": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Original capture origin, or null when absent."
      +        },
      +        "project": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Original resolved project, or null when unresolved."
      +        }
      +      },
      +      "required": [
      +        "project",
      +        "originId"
      +      ],
      +      "type": "object"
      +    },
      +    "scope": {
      +      "description": "Finite explicit owner bounds; project names, origins and legacy attribution are disjoint.",
      +      "properties": {
      +        "legacyAttributions": {
      +          "description": "Explicit legacy ownership classes; neither is a named project.",
      +          "items": {
      +            "enum": [
      +              "legacy_ambiguous",
      +              "legacy_unattributed"
      +            ],
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "originIds": {
      +          "description": "Exact nonempty origin identifiers for unattributed content.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "projects": {
      +          "description": "Exact named projects, including a real project named default if requested.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "surfaces": {
      +      "description": "Original permitted surfaces; reuse can only narrow them.",
      +      "items": {
      +        "enum": [
      +          "cli",
      +          "mcp",
      +          "http"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "version": {
      +      "const": 1,
      +      "description": "Version of this bounded read provenance.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "version",
      +    "request",
      +    "accessId",
      +    "scope",
      +    "surfaces",
      +    "expiresAt"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changedv0.40.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Integrity diagnostics.",
      +  "properties": {
      +    "counts": {
      +      "description": "Issue counts per severity.",
      +      "properties": {
      +        "error": {
      +          "description": "Genuinely invalid data.",
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "info": {
      +          "description": "Declared discontinuities, such as a hard-purge journal gap.",
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "legacy": {
      +          "description": "Readable data that predates a contract.",
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "unsupported": {
      +          "description": "Data from a newer schema or policy this build cannot interpret.",
      +          "minimum": 0,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "error",
      +        "legacy",
      +        "unsupported",
      +        "info"
      +      ],
      +      "type": "object"
      +    },
      +    "issues": {
      +      "description": "Every diagnostic found, each with a stable code and severity.",
      +      "items": {
      +        "description": "One diagnostic. Extra fields identify the affected entity, entry, or scope.",
      +        "properties": {
      +          "code": {
      +            "description": "Stable diagnostic code, such as missing_relation_source, unknown_decision_status, or journal_gap.",
      +            "type": "string"
      +          },
      +          "detail": {
      +            "description": "Human-readable explanation.",
      +            "type": "string"
      +          },
      +          "entityId": {
      +            "description": "Affected entity identifier.",
      +            "type": "string"
      +          },
      +          "entryId": {
      +            "description": "Affected journal entry identifier.",
      +            "type": "string"
      +          },
      +          "recordId": {
      +            "description": "Affected record or fact identifier.",
      +            "type": "string"
      +          },
      +          "relationId": {
      +            "description": "Affected relationship identifier.",
      +            "type": "string"
      +          },
      +          "seq": {
      +            "anyOf": [
      +              {
      +                "type": "integer"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "description": "Affected journal sequence number."
      +          },
      +          "severity": {
      +            "description": "error is invalid data, legacy is readable but predates a contract, unsupported comes from a newer schema this build cannot interpret, info is a declared discontinuity.",
      +            "enum": [
      +              "error",
      +              "legacy",
      +              "unsupported",
      +              "info"
      +            ],
      +            "type": "string"
      +          },
      +          "type": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "description": "Affected journal entry type."
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "severity"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "valid": {
      +      "description": "False when any error or unsupported issue is present.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "valid",
      +    "issues",
      +    "counts"
      +  ],
      +  "type": "object"
      +}
  5. First observedv0.40.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false with destructiveHint=false, which would otherwise look odd for a "diagnose" tool; the description resolves this by explaining that an own-scope read saves nothing while an access key commits a revision and audit. It also discloses the profile/environment gating (SHADOWGRAPH_MCP_PROFILE, SHADOWGRAPH_MCP_COMPACT=0), which no annotation conveys. The only gap is that it doesn't state side effects of a diagnosis that fails partway through.

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?

Purpose is front-loaded in the first clause, followed by sibling routing and then side-effect/mode caveats — a sensible ordering. The telegraphic phrasing ("Own-scope read saves nothing") and the operator-facing environment sentence cost it a point on readability, though nothing is truly redundant.

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, return values need not be explained, and the description covers purpose, alternatives, mutation semantics, and mode gating. Remaining ambiguity is minor, e.g. what exactly constitutes "own scope" versus a project/origin binding.

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 coverage is 100%, so all four parameters including the grantId/accessId alias conflict rule are already documented. The description reinforces the access-key side effect but adds little semantic detail beyond the schema, so the baseline 3 applies.

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 scope: "Diagnose record, graph and journal integrity without applying repairs." It then explicitly distinguishes itself from four named siblings (maintain, review, repair_plan, rebuild) so an agent can route correctly 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?

Gives explicit when-to-use-by-elimination guidance: maintain ages records, review checks decision rules, repair_plan proposes repairs, rebuild checks journal replay, so this tool is the non-repairing diagnostic. It also names the condition (full mode only) under which two of the alternatives are even available.

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