Patch project graph
patch_project_graphApply 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
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Owned Brain Scanner project ID from the account's project list; not a local path or repository URL. | |
| sessionId | No | ID of this project's active agent session, returned when the session was started. Not needed for read-only calls. | |
| upsertEdges | Yes | Edges to insert or replace in the published graph. | |
| upsertNodes | Yes | Nodes to insert or replace, keyed by their stable graph IDs. | |
| removeEdgeIds | Yes | IDs of graph edges to remove from the published snapshot. | |
| removeNodeIds | Yes | IDs of graph nodes to remove from the published snapshot. | |
| idempotencyKey | Yes | 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. | |
| mappedRevision | No | Local revision identifier represented by the submitted mapping. | |
| changeNarrative | Yes | 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. | |
| expectedProjectVersion | Yes | Current hosted project version from the latest project status read; guards against overwriting a newer graph publication. |