Skip to main content
Glama

Set Case Json Data Fields

setCaseJsonDataFields

Set one or more fields of a typed case's structured json_data payload in one atomic write, leaving every other field as stored. Prefer this over PATCH /cases/{case_id} with a full json_data object when changing some fields: the write reads and locks the latest payload in the database, so a concurrent edit to another field, or to another item of the same array, is preserved. Each set entry names a path, a JSONPath declared in the queue's current Case schema, and the value to store there. A path is dotted object fields ($.invoice.amount) with optional array indices in brackets ($.lines[0] for a whole item, $.lines[0].amount for one field of it). An index must name an item that already exists; an out-of-range index or a non-array parent is refused, and a write never adds or removes items. A value can be any JSON value, including an object for an object field. Paths must be distinct, and no path may sit inside another in the same request ($.lines beside $.lines[0], or $.lines[0] beside $.lines[0].amount). An index names a position, so when the array can change between your read and your write, add expect entries that pin the item, such as its id field ($.lines[0].id): if any stored value differs, nothing is written and the response is a 409. The resulting payload is validated against the queue's current Case schema and the case is re-pinned to that schema version; if any entry is refused, nothing is written. A case without a structured payload yet must be given one with PATCH /cases/{case_id} first. Returns the updated case with its event history and approval batches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
setYesThe fields to set, applied together (1 to 100).
expectNoPreconditions checked against the latest stored payload before any field is set (up to 100). If one does not match, nothing is written and the response is a 409. Use them to make sure an array index still names the item you read.
case_idYesThe case's unique identifier

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / expect
      Added value: +{
      +  "description": "Preconditions checked against the latest stored payload before any field is set (up to 100). If one does not match, nothing is written and the response is a 409. Use them to make sure an array index still names the item you read.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "path": {
      +        "description": "JSONPath of a stored value to check, in the same form as a `set` path (e.g. `$.lines[0].id`). Must be declared in the queue's current Case schema.",
      +        "type": "string"
      +      },
      +      "value": {
      +        "$ref": "#/definitions/CaseJsonDataValue",
      +        "description": "The value the case must currently hold at `path`. It must have the field's declared type, or the request is a 400; an absent value never matches."
      +      }
      +    },
      +    "required": [
      +      "path",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 100,
      +  "type": "array"
      +}
    • changedInput schema / properties / set / items / properties / path / description
      Previous value: -"JSONPath of the field to set, in dotted form starting at `$` (e.g. `$.invoice.amount`). Must be declared in the queue's current Case schema."New value: +"JSONPath of the field to set, starting at `$`: dotted fields with optional array indices (e.g. `$.invoice.amount` or `$.lines[0].amount`). Must be declared in the queue's current Case schema, and an index must name an existing item."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover only safety flags (readOnly=false, destructive=false, idempotent=false); the description adds substantial behavior the agent cannot get elsewhere: it reads and locks the latest payload, preserves concurrent edits, refuses out-of-range indices and non-array parents, never adds/removes items, validates against the queue's current Case schema and re-pins it, and returns 409 on a failed `expect`. It is fully consistent with destructiveHint=false since nothing is deleted.

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?

Front-loads the core purpose and the alternative it replaces, and every sentence carries information (path grammar, atomicity, 409 semantics). It is dense and runs long as a single block, so it is efficient rather than maximally tight.

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 mutation tool with no output schema, it covers the return value ('the updated case with its event history and approval batches'), the failure modes (400 for type mismatch, 409 for failed preconditions), the atomicity guarantee, and the schema re-pinning side effect. An agent has everything needed to call it correctly.

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 baseline is 3, but the description goes further: it documents path syntax with examples (`$.lines[0]` vs `$.lines[0].amount`), states that `set` paths must be distinct and non-nested, and explains why `expect` exists (pinning an array item's id across a read/write race). That is meaning beyond the schema's own path/value descriptions.

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: 'Set one or more fields of a typed case's structured `json_data` payload in one atomic write'. It explicitly differentiates itself from the sibling full-payload path (`PATCH /cases/{case_id}`) and from `updateCase`, so an agent can select it without opening any 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 an explicit when-to-use rule ('Prefer this over `PATCH /cases/{case_id}` with a full `json_data` object when changing some fields'), a prerequisite ('A case without a structured payload yet must be given one with `PATCH` first'), and when to add `expect` entries to guard array indices. 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