Claude Tool Use 正式可用

并行工具、图像输入和结构化调用进入 Claude API

Anthropic 宣布 Claude Tool Use 正式可用。开发者用 JSON Schema 定义客户端工具,Claude 返回 `tool_use` 内容块和结构化参数;实际执行、权限检查与结果回传仍由客户端负责。

时间2024 年 5 月 30 日 级别B · 领域级 组织Anthropic 状态已核验 · 1 个来源
中心控制器连接计算器、检索、数据库、键盘、终端与摄像头,形成工具调用环
AI Chronicle 原创插图:Claude Tool Use 把并行结构化调用变成 API 的常规能力,执行仍在客户端。 AI Chronicle

假设用户说:“查一下这个订单,如果还没发货就取消。”一句自然语言里其实藏着两种完全不同的动作。查询只读取状态,取消订单会产生业务后果。模型可以理解句子,也可以决定先查后改,但接触数据库和订单系统的,不应该是模型的一段自由文本。

2024 年 5 月 30 日,Anthropic 宣布 Claude Tool Use 正式可用。开发者用 JSON Schema 描述客户端能够提供的工具;Claude 根据对话选择一个或多个工具,并返回包含名称和结构化参数的 tool_use 内容块。应用收到调用后执行实际操作,再把结果送回模型。模型提出意图,客户端承担动作——这条分工是整个能力的核心。

结构化参数让调用比“从回答里猜 JSON”可靠,却没有把错误清零。模型仍可能选错工具、填入不存在的订单号,或在信息不足时过早发起操作。Schema 能限制类型和字段,不能替业务决定用户是否有权限取消,也不能判断这一次操作是否需要二次确认。越接近有副作用的工具,应用越要把鉴权、幂等、超时和审计放在模型之外。

正式可用让并行工具调用、图像输入配合工具等路径进入稳定的产品文档与示例。客服场景尤其能说明价值:模型先读懂用户表达,再调用查询系统,最后根据返回结果解释下一步。它也暴露了一类新的测试任务。团队不只要测“回答是否正确”,还要测模型选错工具、参数不合法、工具超时和结果缺失时,系统是否会澄清、重试或停止。

Claude Tool Use 与后来的 MCP 位于不同层次。Tool Use 规定模型在一次会话中怎样表达结构化调用;MCP 处理宿主如何发现并连接外部工具。前者把请求说清楚,后者把连接方式做成协议。把两者混在一起,会让权限和错误处理找不到负责的位置。

这次 GA 没有让 Claude 直接获得一串业务系统的钥匙。它做的是把请求钥匙的动作写成机器可以检查的格式。成熟的集成,不是模型从不叫错门,而是叫错时,门仍然不会自动打开。

Consider a user saying, “Check this order, and cancel it if it has not shipped.” One natural-language sentence contains two very different actions. Looking up status only reads. Canceling produces a business consequence. A model can understand the sentence and decide to query before changing anything, but free-form model text should not be what directly touches the order system.

On 30 May 2024, Anthropic announced that Claude Tool Use was generally available. Developers described client-provided tools with JSON Schema. Claude selected one or more tools from the conversation and returned a tool_use content block containing a name and structured arguments. The application executed the operation and sent the result back. The model proposed an intention; the client owned the action. That division was the center of the feature.

Structured arguments were more reliable than trying to extract JSON from prose, but they did not eliminate mistakes. A model could still choose the wrong tool, supply an order number that did not exist, or act too early when information was missing. A schema could constrain fields and types. It could not decide whether the user was authorized to cancel, or whether this action required another confirmation. The closer a tool came to side effects, the more authentication, idempotency, timeout handling, and audit had to remain outside the model.

General availability put paths such as parallel tool calls and image-informed tool use into stable product documentation and examples. Customer support showed the value clearly: a model interpreted the request, queried a system, and explained the next step using returned data. It also created a new class of testing. Teams had to test not only whether an answer sounded correct, but whether the product clarified, retried, or stopped after wrong tool choice, invalid arguments, a timeout, or a missing result.

Claude Tool Use occupied a different layer from the later MCP. Tool Use defined how a model expressed a structured call within a conversation. MCP addressed how a host discovered and connected to external tools. One made the request legible; the other standardized the connection. Combining the layers made it harder to locate responsibility for permission and error handling.

The GA release did not hand Claude a ring of keys to business systems. It made the act of requesting a key machine-checkable. A mature integration is not one in which the model never approaches the wrong door. It is one in which the door still does not open automatically when it does.

展开完整事件档案人物、主题、模型与产品
人物
模型
产品
来源

原始资料

  1. 01Tool use is now generally availableAnthropic · official

试试搜索