MCP Tool Invocation¶
Model Context Protocol tool invocation flow.
Overview¶
MCP (Model Context Protocol) enables AI agents to invoke tools provided by tool servers.
Entities¶
| Entity | Type | Role |
|---|---|---|
agent |
agent | AI/LLM agent |
tool_server |
tool_server | Exposes tools via MCP |
Flow¶
- Tool Discovery: Agent discovers available tools
- Tool Invocation: Agent calls a tool
- Tool Result: Server returns result
Flow Modes¶
| Mode | Use |
|---|---|
tool_call |
Agent invoking a tool |
tool_result |
Server returning result |
Example¶
{
"protocol": {
"id": "mcp-tool-invocation",
"name": "MCP Tool Invocation",
"category": "agent"
},
"entities": [
{"id": "agent", "name": "AI Agent", "type": "agent"},
{"id": "tool_server", "name": "Tool Server", "type": "tool_server"}
],
"flows": [
{
"from": "agent",
"to": "tool_server",
"action": "list_tools",
"mode": "request"
},
{
"from": "tool_server",
"to": "agent",
"action": "tools_list",
"mode": "response"
},
{
"from": "agent",
"to": "tool_server",
"action": "invoke_tool",
"mode": "tool_call"
},
{
"from": "tool_server",
"to": "agent",
"action": "tool_result",
"mode": "tool_result"
}
]
}