Once a universal code execution environment becomes the standard 'super tool' for AI agents, creating new capabilities will no longer require custom code. Instead, 'building a tool' will mean writing a detailed prompt that instructs the LLM on how to sequence actions using an already-exposed, comprehensive API SDK.
To overcome LLM limitations, successful Model Context Protocol (MCP) design involves severe constraints: keep the number of tools low, use precise yet concise names and descriptions, minimize input parameters, and return only essential data. This handcrafted approach is necessary for models to perform reliably.
Don't let LLMs make raw HTTP calls. Instead, provide a code execution tool with a statically typed SDK. This environment can run a type-checker, instantly catching errors when the model hallucinates a non-existent endpoint or parameter, then provide helpful, in-context documentation to correct its mistake.
Trying to secure AI agents by restricting which tools are exposed in the Model Context Protocol (MCP) is the wrong approach. Security should be implemented at the API layer itself using robust, granular permissions like OAuth scopes. Treat the AI agent as any other third-party application accessing your API.
To give an AI assistant persistent knowledge, create a dedicated Git repo. Prompt the AI (e.g., Claude Code) to save important artifacts like customer quotes or useful SQL queries into this repo as markdown files. This creates a curated, searchable 'cache' that bypasses the need to re-query external systems.
The vision for Model Context Protocol (MCP) is to let AIs perform complex, multi-app tasks. However, translating a full API like Stripe's into MCP tools overwhelms current models' context windows, making them confused and ineffective. This forces developers to handcraft a small subset of tools.
To bypass context window limits with large APIs, Stainless uses a 'dynamic mode' for its MCP servers. It provides only three tools: `list endpoints`, `get endpoint details`, and `execute endpoint`. This scales infinitely but adds latency, as the model needs three separate turns to perform a single action.
The next step for agentic AI is a 'cyborg' model. Instead of juggling numerous pre-defined tools, the LLM will have one primary tool: a code execution environment. It will write code against a company's SDK to perform tasks, which is more flexible, faster, and context-efficient than traditional tool calling.
