programmatic-tool-calling-ai-sdk
by cameronking4·★ 17·Score 42
An MCP-enabled SDK that reduces LLM costs 80% by replacing tool calls with generated JavaScript executed in Vercel Sandbox.
Overview
Programmatic Tool Calling AI SDK is an innovative approach to optimize LLM interactions by reducing multiple round-trip tool calls to a single code generation and execution. It wraps MCP tools and local tools, then generates JavaScript code to orchestrate them efficiently in an isolated Vercel environment. The solution supports Anthropic, OpenAI, and 100+ models via AI Gateway, showing significant improvements in token usage (80% reduction), latency (3-5x faster), and context efficiency.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this when you need to optimize costs and performance for applications requiring multiple tool calls, especially when working with both local tools and MCP servers.
When NOT to choose this
Don't choose this if you can't use Vercel services (Sandbox requires Vercel account) or if you need strict tool execution guarantees rather than code generation.
Tools this server exposes
4 tools extracted from the READMEgetUserGet user by ID
calculateAverageCalculate average of numbers
mcp_firecrawl_scrapeScrape URL content using Firecrawl MCP
mcp_github_searchSearch GitHub repositories using MCP
Note: Tool names inferred from usage examples and architecture diagram. MCP tools appear to be dynamically injected through the MCP Bridge.
Comparable tools
Installation
# Install the published package
npm install @task-orchestrator/programmatic-tools
# Required peer dependencies
npm install ai@^5.0.0 @vercel/sandbox@^1.0.0 zod@^3.0.0 ms@^2.1.0
# Optional MCP support
npm install @ai-sdk/mcp@^0.0.11For Claude Desktop MCP server configuration:
{
"mcpServers": {
"programmatic-tools": {
"command": "node",
"args": ["path/to/programmatic-tools/mcp.js"]
}
}
}FAQ
- How does this reduce LLM costs by 80%?
- Instead of N round-trips between LLM and tools, it generates JavaScript code that orchestrates all tools in a single execution, reducing LLM calls from N to ~2 total.
- What MCP transport protocols are supported?
- HTTP, SSE, and Stdio transports are supported with normalization for predictable code access across different MCP servers.
Compare programmatic-tool-calling-ai-sdk with
Last updated · Auto-generated from public README + GitHub signals.