Write shared state
state_writeCreate or update notes in a shared cross-surface state store, and optionally record decision or setting facts so other agents can read exact values and conflicts are flagged.
Instructions
Create a new note in the shared cross-surface state store, or update an existing one if id is given. Returns the resulting note without its body (state_read id=N has it). When the note records a decision or setting, also pass facts: other agents then read the exact value, and a disagreement is caught.
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": "state_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Id of an existing note to update. Omit to create a new note. | |
| body | No | Note body/content. | |
| tags | No | Tags for the note (a list, or one comma-separated string). | |
| facts | No | Settings as key/value pairs, e.g. {"package_manager":"pnpm","test_runner":"vitest"}. Use a common key when one fits: deploy_target, package_manager, test_runner, database, node_version, base_url, ci_provider, formatter. Add a subject prefix only when the project has several (api.deploy_target). At most 10; keys are lowercase a-z 0-9 _ . - (max 40 chars), values one line of at most 80 chars. The reply may carry `conflicts` (another writer states a different value; your write still succeeds, so tell the user) or `similar_keys` and a `hint` (an existing key looks like the same setting; follow the hint). | |
| title | No | Note title. When creating a note without one, it is made from the body's first line (about 60 characters) and the reply says so. | |
| if_rev | No | Compare-and-swap: only update if the note is still at this revision (from a prior read). Omit to force. | |
| source | No | Optional: who or what you CLAIM this note came from (not checked). The server records who really wrote it separately. | |
| namespace | No | Namespace/bucket for the note. Defaults to 'default'. | |
| confidence | No | Optional CLAIM, 0 to 1, of how sure you are of this note (0 = a guess, 1 = certain). It is only your claim: the server stores it next to your name, shows it to readers as a claim, and never uses it to rank notes or to override who is trusted. On update, null removes it. | |
| sensitivity | No | Who may read this note: public, internal (default) or private. A connection with a ceiling cannot read, write or relabel above it; lowering a label needs an admin. | |
| forget_after | No | Retention: days until this note is archived (soft-deleted, restorable). On update, resets the deadline; 0 clears it. Omit to keep the current deadline (none for new notes). |