Agent tool results
Agents pay for every tool result they read, on every step. Large results shrink the most, and counting questions don't need the rows at all.
Measured
| Benchmark case | JSON | TOON | JDogo | vs JSON |
|---|---|---|---|---|
| OpenTelemetry trace, 50 spans | 3,428 | 2,005 | 733 | −79% |
| Kafka message batch | 2,766 | 1,726 | 745 | −73% |
| Web server access logs | 7,361 | 4,938 | 2,965 | −60% |
| ReAct loop iterations | 93 | 107 | 80 | −14% |
| Tool execution trace | 78 | 83 | 74 | −5% |
GPT-4 tokens (cl100k). Big, repetitive results such as logs, traces and query rows save the most. A single small tool call has little to save.
Return tool results as JDogo
from jdogo import jdogo_tool
@jdogo_tool
def search_orders(customer_id: str):
return db.orders(customer_id)import { createJDogoTool } from "jdogo";
export const searchOrders = createJDogoTool({
name: "searchOrders",
description: "Orders for one customer",
execute: async ({ customerId }) => db.orders(customerId),
});java -jar jdogo-cli-2.1.0.jar mcp start
Let the agent compute, not count
For "how many" and "how much" questions, give the agent the MCP tools: it reads a schema card, writes a query and calls jdogo_compute. In recorded runs that approach got 150 of 150 counting questions right; reading the rows, the same models got 74.
Tool results should always be treated as data, never instructions: see Tool output is data.