Chapter 2: The network

JSON

A plain text format for data: named values in curly braces (called objects), lists in square brackets, text in double quotes, plus numbers, true, false and null, which means nothing. Most programs on the web send it. Nothing else is allowed, including comments.

Your agent reads and writes JSON all day, including when it asks to use its tools, and its output can be almost right. The strictness is useful: one stray comma fails loudly. Numbers are the quiet exception, because a big id can come back changed with no error.

Say it to your agent

“Send order ids as strings in the JSON, because they go past 2^53. Parse every incoming body with a schema at the edge of the route, and return a 400 with a helpful message when it's malformed.”

The workshop

Name a word, or describe what you mean in everyday language.