Skip to main content
Glama

Patch project graph

patch_project_graph
DestructiveIdempotent

Apply a bounded delta to the published graph: upserts and removals against one expected version. Removing a node detaches its edges; the result reports exactly what was applied. Requires a changeNarrative with four plain-language sections written by the caller.

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": {
      "projectId": "<projectId>",
      "expectedProjectVersion": "<expectedProjectVersion>",
      "upsertNodes": "<upsertNodes>",
      "upsertEdges": "<upsertEdges>",
      "removeNodeIds": "<removeNodeIds>",
      "removeEdgeIds": "<removeEdgeIds>",
      "idempotencyKey": "<idempotencyKey>",
      "changeNarrative": "<changeNarrative>"
    },
    "name": "patch_project_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectIdYesOwned Brain Scanner project ID from the account's project list; not a local path or repository URL.
sessionIdNoID of this project's active agent session, returned when the session was started. Not needed for read-only calls.
upsertEdgesYesEdges to insert or replace in the published graph.
upsertNodesYesNodes to insert or replace, keyed by their stable graph IDs.
removeEdgeIdsYesIDs of graph edges to remove from the published snapshot.
removeNodeIdsYesIDs of graph nodes to remove from the published snapshot.
idempotencyKeyYesCaller-generated retry key. Reuse the same key and identical payload only to retry the same mutation; use a new key for a new action.
mappedRevisionNoLocal revision identifier represented by the submitted mapping.
changeNarrativeYesWrite four short, privacy-filtered summaries: added, updated, removed and relationships. Describe what changed in the graph; use a plain statement when a section has no changes.
expectedProjectVersionYesCurrent hosted project version from the latest project status read; guards against overwriting a newer graph publication.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / expectedProjectVersion / description
      Previous value: -"Current hosted project version from get_project_status; guards against overwriting a newer graph publication."New value: +"Current hosted project version from the latest project status read; guards against overwriting a newer graph publication."
    • changedInput schema / properties / projectId / description
      Previous value: -"Owned project ID returned by list_linked_projects or map_project; do not use a local path or repository URL."New value: +"Owned Brain Scanner project ID from the account's project list; not a local path or repository URL."
    • changedInput schema / properties / sessionId / description
      Previous value: -"Active session record.id from start_agent_session for this project. Pass it on later project calls after starting the session."New value: +"ID of this project's active agent session, returned when the session was started. Not needed for read-only calls."
  2. Changed7 schema fields changed
    • addedInput schema / properties / changeNarrative / description
      Added value: +"Write four short, privacy-filtered summaries: added, updated, removed and relationships. Describe what changed in the graph; use a plain statement when a section has no changes."
    • addedInput schema / properties / mappedRevision / description
      Added value: +"Local revision identifier represented by the submitted mapping."
    • addedInput schema / properties / removeEdgeIds / description
      Added value: +"IDs of graph edges to remove from the published snapshot."
    • addedInput schema / properties / removeNodeIds / description
      Added value: +"IDs of graph nodes to remove from the published snapshot."
    • changedInput schema / properties / sessionId / description
      Previous value: -"Owned project ID returned by list_linked_projects or map_project; do not use a local path or repository URL."New value: +"Active session record.id from start_agent_session for this project. Pass it on later project calls after starting the session."
    • addedInput schema / properties / upsertEdges / description
      Added value: +"Edges to insert or replace in the published graph."
    • addedInput schema / properties / upsertNodes / description
      Added value: +"Nodes to insert or replace, keyed by their stable graph IDs."
  3. Changed4 schema fields changed
    • addedInput schema / properties / expectedProjectVersion / description
      Added value: +"Current hosted project version from get_project_status; guards against overwriting a newer graph publication."
    • addedInput schema / properties / idempotencyKey / description
      Added value: +"Caller-generated retry key. Reuse the same key and identical payload only to retry the same mutation; use a new key for a new action."
    • addedInput schema / properties / projectId / description
      Added value: +"Owned project ID returned by list_linked_projects or map_project; do not use a local path or repository URL."
    • addedInput schema / properties / sessionId / description
      Added value: +"Owned project ID returned by list_linked_projects or map_project; do not use a local path or repository URL."
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered; the description adds real value beyond that by disclosing the cascade rule ('removing a node detaches its edges') and confirming the response reports exactly what was applied. It stops short of explaining atomicity or partial-failure behavior for large deltas.

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?

Three sentences, front-loaded with the core action and scope, followed by the consequential side effect and the mandatory narrative field. No filler or restated title material.

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 ten-parameter destructive mutation with a nested array-heavy schema and no output schema, the description supplies the key missing pieces: version guard, cascade behavior, and a summary of the response. Remaining gaps — whether the whole patch is atomic, and limits on delta size — are modest but real for a destructive operation.

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; the description earns extra credit by explaining that the patch is bounded and validated against one expected version and by giving the cascade semantics of removeNodeIds that the schema only labels as 'IDs of graph nodes to remove'. The changeNarrative's four-section requirement is restated but its meaning is largely already 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?

The description names a specific verb and resource ('apply a bounded delta to the published graph') and adds scope that separates it from siblings: upserts and removals against one expected version. That is clearly distinct from clearing, exporting, validating or rebuilding the graph without needing to open a 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 gives clear operating context — an incremental patch bound to an expected project version, with a mandatory changeNarrative — so an agent knows the preconditions for calling it. It does not, however, state when to prefer a different tool (for example validating or rebuilding instead of patching), so alternatives remain implicit.

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