07When a server ships 100 tools

Call every server
from one snippet.

The model reaches your MCP servers, your past conversations, and the decision engine by writing Python in one code tool. The tool definitions never change when a server connects, so the prompt cache holds, and a snippet returns only what the model needs to read.

The code card with a snippet that calls home.intent__HassTurnOff for five lights through asyncio.gather. Below it, each call is a child row, Turn off with the name of the light, marked action done with a check mark for Bed Light, Ceiling Lights, Entrance Color + White Lights, and Kitchen Lights.

Terminal recording · Call MCP servers from PythonA real session in the demo project, with Home Assistant and its demo integration running in a local container as an MCP server. /mcp lists the home server with 28 tools via code. The prompt asks to turn off every light except the living room and for the temperature of each climate device. The model writes Python in the code tool: one snippet reads the live context, and a second turns off five lights at once with asyncio.gather. Each server call passes the permission rules, so the take allows the read for the conversation, and the light calls with any arguments after a second Enter. The reply says that it left the living room lights on and shows a table of three climate devices. A question about the front door asks again, because Home Assistant lock devices always ask.Open in the gallery
The reply Defined and ran list_orders_pages(240) in the code tool, above a table of limit, nonempty pages, last nonempty page size, calls until a null cursor, and final page size. A limit of 7 gives 35 pages with 2 orders on the last and 36 calls, and every final page is empty. Below, the reply says that src/pagination.ts:29 returns a cursor for every nonempty page, including the last one, so following cursors until null takes one extra call that returns an empty page.

Terminal recording · Compute with PythonA real session in the demo project, in Plan mode. The prompt asks for a function that counts the pages listOrders returns at four limits, run for 240 orders. The model reads src/orders.ts and src/pagination.ts, defines list_orders_pages in the code tool, and shows a table: 35, 10, 5, and 3 pages. It also notes the extra call that returns an empty page. The follow-up asks for 1,000 orders, and the second snippet is one line, list_orders_pages(1000), because the function is still defined. The interpreter has no file system, network, or environment variables.Open in the gallery
A code card that calls history.search for front door, newest first, limited to user and assistant messages. Its row reads keyword order, 3 of 3, and lists the matches: this question, and from the session Home Assistant: Turn Off Lights and Report Climate Temperatures, the answer No, the front door is unlocked, and the question Is the front door locked?

Terminal recording · Search past conversations from PythonA real session in the demo project, in Plan mode. The prompt asks when we last asked whether the front door was locked, and what the answer was. In the code tool, the model reads help("history") first, then calls history.search for the exact words front door, newest first. Searching this project asks no permission. The search row lists the matching messages with their sessions, and the reply gives the time of the question from the Home Assistant session and its answer: the front door was unlocked.Open in the gallery
  • One tool for every MCP server

    The model never sees an MCP tool definition. It calls your servers from Python, and a snippet can call several tools at once. A server that connects, fails, or changes its tools never changes the tool definitions or the system prompt.

  • Filter before the model reads

    A snippet can filter, join, and summarise results before the model reads anything. Only what it prints and the value of its last expression come back, so a list of 500 issues can come back as three lines.

  • Python in an isolated worker

    code runs snippets in a separate worker with no file system, network, environment variables, or subprocesses. A snippet that calls nothing outside the worker runs without a prompt, and each call it makes, such as a search of your past conversations, is checked on its own. timeoutSec bounds the whole run, waits included.

  • Judgement inside the snippet

    decisions.decide() and decisions.rerank() judge what a snippet gathered before any of it reaches the model.

  • Past conversations from Python

    A snippet can search the history of this project or of every project to find an earlier decision or a command that worked.

  • JavaScript when the meaning holds

    A snippet written in JavaScript or TypeScript runs as Python when every part of it has a Python form that keeps its meaning. Anything else does not run, so a translation never guesses.