Pure data manipulation primitives over JSON / CVM data. Provides deep merge, conditional selection, path-based assoc, and key-based selection. All operations are pure functions with no IO and sub-millisecond execution. Use these to compose structured outputs and branch on prior step results in declarative orchestrations.
| Name: | json |
| Class: | covia.adapter.JSONAdapter |
This adapter provides 4 MCP tool(s) for AI agent integration:
| Tool Name | Description |
|---|---|
| json_merge | Deep-merges a vector of maps using RFC 7396 JSON Merge Patch semantics. Later values win on key conflict; recursive maps merge recursively; null values delete the key from the target. Use to compose a structured output from multiple prior step results. |
| json_assoc | Returns a new map with 'value' set at 'path' inside 'target'. Path may be a single string key or a vector of keys for nested paths. Intermediate maps are created if missing. Equivalent to Clojure assoc-in or Lodash _.set. |
| json_cond | Picks the 'then' value of the first case whose 'when' is truthy. Truthiness is strict: only JSON false and null are falsy; everything else (including 0, empty strings/arrays/objects) is truthy. Use to express declarative branching based on prior step results. |
| json_select | Picks a value from a map of cases by key. If 'key' is present in 'cases', returns its value; otherwise returns 'default' (or null). Use for declarative branching when you have a discriminator string — like a switch statement. |