- Home
- Developer Tools
- Code Mode
Code Mode
π Plug-and-play library to enable agents to call MCP and UTCP tools via code execution.
Rating
Votes
0
score
Downloads
0
total
Price
Free
API key required
Works With
About
-->
π€ Code-Mode Library: First library for tool calls via code execution
[](https://www.npmjs.com/package/@utcp/code-mode)
Transform your AI agents from clunky tool callers into efficient code executors β in just 3 lines.
Why This Changes Everything
LLMs excel at writing code but struggle with tool calls. Instead of exposing hundreds of tools directly, give them ONE tool that executes TypeScript code with access to your entire toolkit.
Apple, Cloudflare, and Anthropic say that Code-Mode is a more efficient way to approach tool calling compared to the traditional dump function information and then extract a JSON for function calling.
Benchmarks
Independent Python benchmark study validates the performance claims with $9,536/year cost savings at 1,000 scenarios/day:
| Scenario Complexity | Traditional | Code Mode | Improvement |
|---|---|---|---|
| Simple (2-3 tools) | 3 iterations | 1 execution | 67% faster |
| Medium (4-7 tools) | 8 iterations | 1 execution | 75% faster |
| Complex (8+ tools) | 16 iterations | 1 execution | 88% faster |
Why Code Mode Dominates:
Batching Advantage - Single code block replaces multiple API calls Cognitive Efficiency - LLMs excel at code generation vs. tool orchestration Computational Efficiency - No context re-processing between operations
Getting Started
Get Started in 3 Lines
import { CodeModeUtcpClient } from '@utcp/code-mode';
const client = await CodeModeUtcpClient.create(); // 1. Initialize
await client.registerManual({ name: 'github', /* MCP config */ }); // 2. Add tools
const { result } = await client.callToolChain(`/* TypeScript */`); // 3. Execute codeThat's it. Your AI agent can now execute complex workflows in a single request instead of dozens.
What You Get
Progressive Tool Discovery
// Agent discovers tools dynamically, loads only what it needs
const tools = await client.searchTools('github pull request');
// Instead of 500 tool definitions β 3 relevant toolsDon't lose this
Three weeks from now, you'll want Code Mode again. Will you remember where to find it?
Save it to your library and the next time you need Code Mode, itβs one tap away β from any AI app you use. Group it into a bench with the rest of the team for that kind of task and you can pull the whole stack at once.
β‘ Pro tip for geeks: add a-gnt π€΅π»ββοΈ as a custom connector in Claude or a custom GPT in ChatGPT β one click and your library is right there in the chat. Or, if youβre in an editor, install the a-gnt MCP server and say βuse my [bench name]β in Claude Code, Cursor, VS Code, or Windsurf.
a-gnt's Take
Our honest review
This plugs directly into your AI and gives it new abilities it didn't have before. π Plug-and-play library to enable agents to call MCP and UTCP tools via code execution. . Once connected, just ask your AI to use it. It's completely free and works across most major AI apps. This one just landed in the catalog β worth trying while it's fresh.
Tips for getting started
Tap "Get" above, pick your AI app, and follow the steps. Most installs take under 30 seconds.
Heads up: this needs an API key to work. You'll get one from the service's website (usually free). The setup guide tells you exactly where.
What's New
Imported from GitHub
Ratings & Reviews
0.0
out of 5
0 ratings
No reviews yet. Be the first to share your experience.