Adapter Details: json

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

MCP Tools

This adapter provides 4 MCP tool(s) for AI agent integration:

Tool NameDescription
json_mergeDeep-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_assocReturns 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_condPicks 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_selectPicks 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.

Navigation

Back to all adapters

Back to index