Skip to main content
Glama

Set Case Json Data Fields

setCaseJsonDataFields
Destructive

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

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.9/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses read-and-lock semantics, atomicity ('if any entry is refused, nothing is written'), 409 on `expect` mismatch, out-of-range/non-array index refusal, no add/remove of array items, schema validation and case re-pinning, and the return shape (updated case with event history and approval batches). The destructiveHint annotation is consistent with the described overwrite behavior.

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?

The critical routing information (purpose, alternative, prerequisite) is front-loaded and almost every sentence carries substantive constraint detail. However it is a single dense paragraph of roughly 300 words, and the path/indices/`expect` rules could be split or tightened for scanability without losing meaning.

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, the description covers all the gaps that matter: prerequisites, atomicity, error conditions (409, 400), index constraints, validation, and the return value. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, but the description adds meaning not in the schema: JSONPath syntax with dotted fields and bracket indices, the rule that indices must name existing items, that paths must be distinct, and that no path may nest inside another in the same request. It also explains the purpose of `expect` (pinning an array item by id before a concurrent-write-sensitive set).

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 specific verb and resource ('Set one or more fields of a typed case's structured `json_data` payload in one atomic write') and immediately differentiates itself from the sibling write path (`PATCH /cases/{case_id}` with a full `json_data` object). An agent can distinguish this from `updateCase` 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?

Explicitly names the alternative (`PATCH /cases/{case_id}`) and the condition that selects this tool ('when changing some fields'), plus the prerequisite that a case with no structured payload must be initialized via PATCH first. It also states when to add `expect` entries (when the array can change between read and write). No usage inference is left to the agent.

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