Claude Code 学习站

CCA-F 练习题库· Tool Design & MCP Integration

每个设计良好的 tool definition 都必须包含哪三个要素?

  1. Aname、description 和 input schema
  2. Bname、price 和 version
  3. Cname、output schema 和 authentication
  4. Ddescription、examples 和 timeout

正确答案:A

解析

  • Ais correct。Anthropic 的 tool use 文档显示,每个自定义工具的定义都由三个字段构成:name(Claude 调用该工具时使用的标识符)、description(用自然语言说明何时以及为何使用该工具的文本,Claude 正是读它来决定是否调用)、以及 input_schema(一个 JSON Schema 对象,声明参数、参数类型及其说明)。文档中用作佐证的示例把 get_weather 定义为恰好包含这三个 key。干扰项都是错的:
  • BCDprice/version(B)、output schema/authentication(C)与 examples/timeout(D)都不是 tool definition 的必需要素。

延伸阅读

本题为本站自有原创练习题,非任何官方考试内容;解析对照 Anthropic 公开文档撰写, 如与最新文档不符请以官方为准。想在限时环境下检验水平,可参加 模拟考(题目与本页题库不重叠)。