Connecting tools: tool calling and the Model Context Protocol
Key takeaway
Tool calling means a language model produces structured calls to predefined functions that your code executes. The Model Context Protocol (MCP) is an open standard that exposes such tools in a uniform way so they can be reused across many AI applications. For start-ups, MCP is both a toolkit for their own agents and a potential distribution channel for their product.
Lessons in this path
How does tool calling work?
You describe a function to the model with a name, purpose and input schema, for example “find_customer(email)”. The model decides whether and with which arguments it wants to call the function and returns a structured call. Your code executes the function, checking permissions and inputs along the way, and returns the result to the model. The model itself never runs code; it only expresses requests.
This leads to the most important security principle: every check that matters belongs in your code, not in the instructions to the model. “Only delete your own records” in a prompt is a wish; a permission check in the function is a guarantee.
What is MCP and why does it matter for start-ups?
The Model Context Protocol was published by Anthropic as an open standard and is now supported by many vendors and tools, including desktop assistants, coding agents and development environments. An MCP server exposes tools, data and prepared prompts; an MCP client, such as an AI assistant, can use them without a separate integration for every combination.
For start-ups this creates two perspectives. Internally, you can use existing MCP servers for ticket systems, databases or documentation instead of writing your own integrations. Externally, your own MCP server can make your product available inside your customers’ AI assistants. For B2B software this is increasingly expected, much like a public API used to be.
How do you design good tools for agents?
Tools for agents are not a one-to-one copy of your API. A model works better with a few task-oriented tools than with a hundred fine-grained endpoints.
- Name by task: “search_invoices” instead of “get_v2_invoices_list”.
- Write the description as for a new colleague, including when the tool does not fit.
- Separate read and write tools.
- Keep outputs short and return only relevant fields.
- Phrase error messages so the model can understand and correct them.
Test tool descriptions like copy: when the model misuses a tool, an unclear description is often the cause.
Going deeper: securing MCP connections
MCP makes connections easier, and therefore mistakes too. Three risks stand out. First, prompt injection: content returned by a tool, such as a customer message or a web page, can contain instructions the model follows. Second, overly broad permissions: a server with write access to everything turns any manipulation into damage. Third, third-party servers: an MCP server from an unknown source is code running in your environment or seeing your data.
Countermeasures: for remote servers, use the OAuth-based authorization foreseen in the specification instead of shared keys, grant permissions per user rather than per server, require confirmation for write actions, and never combine in one session access to private data, untrusted content and the ability to send data outward. That combination is the classic pattern for data exfiltration.
Example: an MCP server for a project management tool
A fictional start-up offers project management for agencies. Customers ask whether they can query their projects from their AI assistant. The team builds an MCP server with four tools: search projects, show a project’s tasks, create a status report and create a task.
The first three are read-only and available to all users. Creating tasks requires confirmation in the client and respects existing roles. Sign-in uses OAuth with the normal user account, so everyone sees only what they see in the app. In the first test the model creates status reports for the wrong projects because project names are similar. The team adds the project ID to the search output and a clarifying question when results are ambiguous.
Common mistakes
- Exposing the entire REST API unfiltered as tools.
- Stating security rules only in the prompt instead of enforcing them in code.
- Installing MCP servers from unknown sources without review.
- Using one shared service key for all users.
Frequently asked questions
Does MCP replace a public API?
No. MCP usually sits on top of your API and translates it into task-oriented tools for AI applications. Developers integrating the classic way still need a documented API.
How much effort is a first MCP server?
As rough orientation: a read-only prototype using the official SDKs is often doable in a few days. Production readiness with authentication, permissions, logging and tests takes considerably longer.
Does MCP work with all models?
MCP is model-agnostic. What matters is whether the client you use supports the protocol. Check the documentation of the respective application.
Try it yourself
List the five most common tasks customers complete with your product. Design at most five tools for them, with name, description, inputs and whether they read or write.
Check your result
Each tool is understandable without looking at the code, write tools require confirmation, and permissions are checked per user.