(no title)
zekejohn | 1 month ago
Codecall is an open source approach that lets agents write and execute TypeScript code in a secured Deno sandbox to orchestrate multiple tools programmatically, like calling an API (which is really all a tool is!)
So instead of 20+ inference passes and 90k+ tokens, the agent can just write and execute:
const tasks = await tools.todoist.findTasks({ completed: true }); for (const task of tasks) { await tools.todoist.deleteTask({ id: task.id }); }
2 inference passes. The code runs in a Deno sandbox, executes all operations programmatically, and returns a result. In our demo, for one example, this reduced tokens by 74.7% and tool calls by 92.3% while being much faster as well.
How it works (high level) ->
1. There are only 2 tools (readFile, executeCode) + a file tree. The agent reads SDK files on demand, so a 30 tool setup is effectively the to a 5 tool setup (only the file tree gets bigger)
2. Multiple tool calls happen in one execution, not N inference calls for N operations... because the agent can write code to execute and orchestrate multiple tools (like API) this significantly reduces the number of passes + tokens per request
3. Models have a 10-50% failure rate searching through large datasets in context. Code like users.filter(u => u.role === "admin") is deterministic and avoids those failure, so not only is it more efficient & cheaper. its also often much more accurate when doing operations with lots of data!
We also generate TypeScript SDK files from MCP tool definitions, so the agent sees clean types and function signatures. It also learns from errors, so when a tool call fails, it updates the SDK file with learned constraints so future agents avoid the same mistake.
Codecall works with any MCP server (stdio/http). Would love feedback from anyone interested in or building more complex agents :)
No comments yet.