Tool Notes and Best Practices
Applies to:
v4.0.8.2
1. Entry-point decision map
How to read this diagram
generate_tool_command()is the formal entry because it explicitly means “plan only”.must_call()andasync_must_call()still work, but should now be treated as compatibility wrappers.
2. Prefer protocol stability
- use
next_action + execution_commands[]in new code - do not omit
execution_commands[*].todo_suggestion - do not keep designing new systems around
tool_commands
3. Keep planning and execution separate
- planner decides what should happen
- executor performs side effects
- final response consumes
action_results
This separation makes loops easier to audit and less likely to spin out of control.
4. Where generate_tool_command() fits
Use it for:
- external approval
- custom execution sandboxes
- multi-system orchestration
must_call() and async_must_call() are now compatibility-only concepts.
5. Correct mental model for Browse
Browse returns readable evidence, not the final answer itself.
Recommended chain:
Searchfinds candidatesBrowsereads body content- the model answers from evidence
- the final answer cites evidence or URLs
6. Safety boundaries
- high-risk tools like
Cmdmust have allowlists - do not rely on model self-restraint for writes
- validate
BrowseandSearchoutputs for length and error strings
7. Concurrency and timeout
- start conservatively with
max_rounds=3~5 - keep
concurrencylow when dependencies are unstable - Playwright-based Browse runs cost more time and resources
8. Observability and debugging
Check first:
extra.tool_logssuccesserrortodo_suggestion
If needed, enable:
runtime.show_tool_logs
9. Daily News Collector takeaway
Agently-Daily-News-Collector enables BROWSE.enable_playwright: true by default because many news sites require browser rendering before stable body text becomes available.
The practical lesson is:
- treat
Browseas a multi-backend page reader - stop treating Playwright/PyAutoGUI as standalone business-layer tools