Skip to main content

> GUIDE // TOOLS

Tool Execution & Code Mode Runtime

Isolated Linux sandboxes, Chrome DevTools Protocol browser automation, and Code Mode single-pass plan execution.

Executive Overview

Modern agents execute actions through isolated container sandboxes, headless browser automation, and Code Mode (where agents author executable TypeScript scripts instead of making dozens of JSON-RPC roundtrips).

1. Code Mode vs Traditional Tool Calling

In traditional tool calling, invoking 5 APIs requires 5 sequential network roundtrips with the LLM.

Code Mode changes this paradigm:

  • The LLM is provided with a concise TypeScript definition index.
  • The model writes an executable TypeScript program that orchestrates multiple tools, filters data, and performs loops locally inside the sandbox in a single pass.

Frequently Asked Questions

Why is Code Mode more token-efficient?

Intermediate API payloads (e.g. 500KB JSON responses) stay inside the execution sandbox and are filtered with code before returning only the essential answer to the LLM.

AI Summary

Modern agents execute actions through isolated container sandboxes, headless browser automation, and Code Mode (where agents author executable TypeScript scripts instead of making dozens of JSON-RPC roundtrips).