Skip to main content

JOY Automart · Knowledge and company

Code Mode for JOY Automart's agent tools

Code Mode for JOY Automart's agent tools is a developer preview and is not live yet. Instead of calling tools one at a time, an AI agent writes a single script that runs in a sandbox, chains search, compare, buying guide and handoff, and returns only the answer.

How it works

With classic tool calling, every tool result passes back through the model before the next call. Code Mode gives the model two tools, get_types and run_code, so it can write the whole journey as one JavaScript function.

Intermediate results stay inside the sandbox. Only the value the script returns goes back to the model.

Safety

Each script runs in its own isolated Cloudflare Worker with outbound network access blocked; the JOY tools are the only way out.

Eight tools read public data and the two prepare_* tools only compose links and an enquiry for a person to review. No tool places an order, takes a payment, reserves a car or bids at auction.

Every run is limited by a tool-call cap, a time limit, a CPU limit and size limits on scripts, arguments and results. The sandbox has no keys or cookies.

Measured figures

In the Worker's own tests against recorded responses, a four-step buyer journey (search, compare, buying guide, handoff) used about 524 estimated tokens of model context with Code Mode, against about 2,318 with plain tool calls: one round trip instead of four.

The Code Mode tool list is 2,108 characters, against 38,504 for the 10 public tools: 94.5% smaller. Token figures are estimates (characters divided by four), not tokeniser counts. Reading the full type definitions once with get_types adds about 31,700 characters.

Tools

A script can call the same 10 public tools as JOY's MCP server: search_vehicles, get_vehicle, compare_vehicles, search_auctions, get_auction, search_parts, get_part, get_buying_guide, prepare_vehicle_handoff and prepare_part_handoff.

Access

Code Mode is not yet available. Developers can request access through /customer-service, partners can contact the B2B team at /b2b, and the public MCP server described at /developers can be used today.