Back to full roadmap
topiccore
Tool Result Formatting
Tool output = prompt to the model. Too large blows context; structure with XML/JSON.
2 hours1 prereqs
Patterns:
- Compact JSON —
{"temp": 22, "condition": "sunny"}— small, parser-friendly. - Markdown table — human + model readable for multiple rows.
- XML sections — for complex nested data:
<weather><current>...</current><forecast>...</forecast></weather>. - Summary + raw — large data: 100-token summary first, then optional raw
<raw>...</raw>block.
Pro: prefix the result with a context sentence like Result for query 'X': — the model instantly knows what it's a result of.
Anti-pattern: raw HTML, raw SQL output, 10K-line log dumps — kill the context.