"External tools, standard protocol" — discover, assemble, invoke. The Agent doesn't need to know who wrote the tool.

The problem

Before this article, all of the Agent's tools were hand-written—bash, read, write, task, worktree. Each tool's input validation, execution logic, and error handling were written line by line by you (the AI).

Now you have 3 external services you want to integrate: the company's Jira API (query issues, create tickets), a self-built deployment system (trigger deploys, view logs), and the team's Notion knowledge base (search documents, create pages). You don't want to rewrite a set of tool code for each service.

You need a standard protocol—external services only need to implement it, and the Agent can call them directly, no matter what language the service is written in.

The solution to this problem is MCP. If you don't yet have a basic understanding of MCP, you can check out this article:MCP

The solution

MCP Tools — External Tools, Standard Protocol

MCP (Model Context Protocol) defines how the Agent discovers and invokes external tools. Core concepts:

Concept

Role

MCPClient

The client on the Agent side, connecting to servers, discovering tools, and invoking tools

MCP Server

External service, implementing tools/list + tools/call

assemble_tool_pool

Assemble built-in tools and MCP tools into a single tool pool

mcp__server__tool naming

Avoid tool name conflicts across different servers