In agent workflows, almost every boundary is JSON: the tool call is JSON, the input is JSON, the output is JSON, and the next step consumes JSON. When the format drifts — extra keys, inconsistent key order, strings where numbers belong — the pipeline fails in ways that are hard to trace.
Make validation the first step
Validate at the boundary, not at the end. A tool that accepts JSON should check structure before doing work: is it an object? Are required fields present? Are types correct? This is what the inputSchema in a manifest is for — it tells the caller exactly what will pass, so failures happen at the call site, not mid-pipeline.
Going deeper on this theme: How to Remain Valuable When Intelligence Becomes Cheap — the scarce human, economic, and strategic advantages that stay valuable when AI does the cognitive work. A 224-page practical book, $3.84. Read it on Gumroad →
Normalize early, compare late
Key order and formatting differences cause false negatives in comparisons and ugly diffs. Two small habits fix most of it: normalize keys to a consistent order, and compare canonical forms rather than raw text. The JSON Key Sorter and JSON Formatter & Validator exist for exactly these steps.
Clean data at the source
Much of the JSON in agent pipelines starts life as CSV or messy text. Converting early — with CSV to JSON (Flattened) and the CSV Delimiter Detector — gives you structured data with known types before any model sees it. That is cheaper than repairing bad JSON later.
The shape of a reliable pipeline
- Parse and validate against the schema.
- Normalize keys and types.
- Transform with single-purpose tools.
- Validate the output the same way.
Same format in, same format out, with a checkpoint at every step. That is what makes an agent pipeline boring — which is exactly what you want.