BlogAPI design

Short fields in AI responses

Readable field names keep responses straightforward for application code and AI tools. Measure token use with the model you actually use.

An AI tool can return the same JSON you'd use in application code. That makes the shape of the response worth paying attention to: the field names and surrounding structure travel with the values.

For example, these fields sit together in a postal lookup. This is an excerpt:

{
  "postal": "90210",
  "city": "Beverly Hills",
  "state": "CA",
  "state_name": "California",
  "country": "US"
}

state_name tells you what the value is without making you walk through a separate metadata object. The code is useful when you need a code, and the full name is there when you're displaying it. Neither needs a long field name to explain its job.

If you're measuring token use, count the complete tool response with the tokenizer for the model you're using. The values, field names, and formatting all contribute. A shorter string isn't automatically fewer tokens, so a character count isn't enough to claim a saving.

The MCP connection gives AI tools access to these lookups. The response should still be easy for you to read when you're checking what the tool returned.