Files
nexus/wiki/concepts/Tool-Calling.md

41 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Tool Calling"
type: concept
tags: [ai, mcp, tools, function-calling]
sources: []
last_updated: 2026-04-22
---
## Overview
Tool Calling工具调用是 MCP 协议中的核心机制之一,类似于 HTTP POST 请求,用于触发外部工具执行具体操作,实现 AI 大模型与外部服务的功能交互。
## Aliases
- 函数调用
- 工具执行
- Function Calling
## Key Characteristics
- **触发机制**:通过 MCP 协议的消息传递触发外部工具
- **参数传递**:支持结构化参数传递给被调用的工具
- **结果返回**:工具执行结果通过 MCP 协议返回给 AI 模型
- **工具链**多个工具可按顺序调用形成工具链MCP Tool Chain
- **自动执行**:在 Cursor Composer Agent 模式下可自动执行,无需手动干预
## MCP 协议中的工具调用接口
- **类型**POST 类接口MCP Server 的三大接口之一)
- **协议层**MCP Client ↔ MCP Server 之间的工具调用通信
- **场景**数据查询、API 调用、命令执行、文件操作等
## Tool Chain Example
```
用户请求 → AI模型推理 → Tool Calling(MCP) → MCP Server 执行 → 结果返回 → AI模型整合响应
```
## Connections
- [[MCPModel Context Protocol]] — Tool Calling 的协议基础
- [[Sequential Thinking]] — 可调用 Tool Calling 实现分步推理
- [[Agent模式]] — Agent 模式下自动执行 Tool Calling
## Sources
- [[mcp在cursor中的集成与应用详解]]