Update a linked companion's tracked values
vault_update_companion_stateWrite a LINK-mode companion row's transient overlay — the locally-tracked hit points, temp HP, hit dice, death saves, exhaustion, stress marks, and trackable/free-cast counters for a buddy the user doesn't own. The source character is never written. The state you send replaces the row's stored overlay wholesale: vault_get_character the Main first, modify that row's state, send it back complete. Maximums never belong in the overlay (they derive from the source; vault drops them). Rows in 'owned' (or legacy 'clone') mode have no overlay — edit the referenced character directly with vault_update_character instead. REQUIRES baseUpdatedAt: copy updatedAt from a fresh vault_get_character read of the MAIN character; a stale value is rejected with OUT_OF_SYNC and nothing is written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Mongo `_id` of the Main character carrying the companion row. | |
| state | Yes | The row's complete replacement overlay. ATOMIC: what you send replaces the stored `state` wholesale — vault_get_character first, modify the returned row's `state`, and send it back complete. Stores current values only; maximums always derive from the source character and are dropped if sent. | |
| companionId | Yes | The companion ROW's `_id` from the Main character's `companions[]` array — NOT the buddy character's own `_id`. | |
| baseUpdatedAt | Yes | REQUIRED proof that you are working from the latest version: copy the `updatedAt` value verbatim from a FRESH read of this exact record (use the matching get tool first). Values from memory, from an earlier conversation, or guessed timestamps are rejected with OUT_OF_SYNC and nothing is written. After a successful update, the response carries the new `updatedAt` — use that for any follow-up write. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||