Skip to main content
Glama

Embers: Tabletop RPG Toolkit

Update a linked companion's tracked values

vault_update_companion_state
Idempotent

Write 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

TableJSON Schema
NameRequiredDescriptionDefault
idYesMongo `_id` of the Main character carrying the companion row.
stateYesThe 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.
companionIdYesThe companion ROW's `_id` from the Main character's `companions[]` array — NOT the buddy character's own `_id`.
baseUpdatedAtYesREQUIRED 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / state / properties / exhaustion / description
      Previous value: -"5e24 Exhaustion level (0-6) tracked locally for the buddy."New value: +"Exhaustion level, within the schema's range, tracked locally for the buddy."
    • changedInput schema / properties / state / properties / hitDice / properties / pools / items / properties / dice / description
      Previous value: -"Die size of this pool, e.g. 'd10'. Must match a pool on the source character."New value: +"Die size of this pool. Must match a pool on the source character."
  2. Changed6 schema fields changed
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / baseUpdatedAt
      Added value: +{
      +  "description": "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.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / companionId
      Added value: +{
      +  "description": "The companion ROW's `_id` from the Main character's `companions[]` array — NOT the buddy character's own `_id`.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / id
      Added value: +{
      +  "description": "Mongo `_id` of the Main character carrying the companion row.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / state
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "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.",
      +  "properties": {
      +    "deathSaves": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "failures": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "successes": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "dying": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "current": {
      +          "type": "number"
      +        },
      +        "wounds": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "exhaustion": {
      +      "description": "5e24 Exhaustion level (0-6) tracked locally for the buddy.",
      +      "maximum": 6,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "health": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "fatigue": {
      +          "type": "number"
      +        },
      +        "incapacitated": {
      +          "type": "boolean"
      +        },
      +        "wounds": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "hitDice": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "current": {
      +          "type": "number"
      +        },
      +        "pools": {
      +          "items": {
      +            "additionalProperties": {},
      +            "properties": {
      +              "current": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "dice": {
      +                "description": "Die size of this pool, e.g. 'd10'. Must match a pool on the source character.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "hitPoints": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "current": {
      +          "type": "number"
      +        },
      +        "temp": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "spells": {
      +      "description": "Free-cast counter positions on the source's spell entries.",
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "current": {
      +            "type": "number"
      +          },
      +          "sourceId": {
      +            "description": "The `_id` of the matching trackable / spell entry on the SOURCE character.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "stress": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "boxes": {
      +            "items": {
      +              "additionalProperties": {},
      +              "properties": {
      +                "marked": {
      +                  "type": "boolean"
      +                },
      +                "sourceId": {
      +                  "description": "Mongo `_id` reference (24-character hex string).",
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "sourceId": {
      +            "description": "The `_id` of the matching stress track on the SOURCE character.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "trackables": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "current": {
      +            "type": "number"
      +          },
      +          "sourceId": {
      +            "description": "The `_id` of the matching trackable / spell entry on the SOURCE character.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / required
      Added value: +[
      +  "id",
      +  "companionId",
      +  "baseUpdatedAt",
      +  "state"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare the safety profile (readOnly false, idempotent true, destructive false), and the description adds rich context beyond them: the source character is never written, maxes are dropped, the overlay replaces wholesale, and stale baseUpdatedAt is rejected with OUT_OF_SYNC writing nothing. The only small gap is it does not detail response shape, though an output schema exists.

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?

Sentences are long and dense but front-load the core action, then layer the atomic-replace rule, the sibling alternative, and the baseUpdatedAt prerequisite in a logical order. Every sentence carries distinct operational meaning; slightly verbose for a description but justified by the complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a nested, atomic write tool with 100% schema coverage and an output schema, this description covers the mutation semantics, the source-vs-overlay split, the sync-proof requirement, and the failure mode. An agent has everything needed to call it correctly without the schema.

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 coverage is 100%, so the schema already documents the parameters and baseline would be 3. The description goes beyond it by explaining the read-modify-write pattern for `state`, that it is an atomic wholesale replacement, that maximums are dropped, and that `baseUpdatedAt` must be copied verbatim from a fresh read — meaningful semantics not derivable from the schema alone.

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 precise verb and resource ('Write a LINK-mode companion row's transient overlay') and enumerates exactly which fields it covers (HP, temp HP, hit dice, death saves, exhaustion, stress, counters). It also explicitly distinguishes itself from vault_update_character for owned/clone rows, so an agent can differentiate it from siblings without opening either 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 (LINK-mode transient overlay for an unowned buddy), when-not-to-use ('Rows in owned or legacy clone mode have no overlay — edit the referenced character directly with vault_update_character instead'), and the required workflow (vault_get_character the Main first, modify, send back complete). Nothing is left to inference.

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