Skip to content

Tool Interface

tool_interface 描述一个已声明工具在运行时如何表现。它比 function signature 更深:它告诉 agent runtime 如何 validate、authorize、execute、stream、render、persist 与 audit 一次工具调用。

必须分区

分区字段
Identitytool_idnamealiasesnamespacenative_idsuser_facing_name
Discoverysearch_hintdescriptioncapability_refsschema_visibilityshould_deferalways_load
Schemasmodel_input_schemaruntime_input_schemaoutput_schemastrict
Availabilityis_enabledrequires_setuprequired_credentialsmodel_requirementsfeature_gate_refs
Validationschema_validationvalue_validationio_preflight_validationdeny_before_io
Safetyis_read_onlyis_destructiveis_open_worldrequires_user_interactionsandbox_profileclassifier_input
Permissionpermission_profile_refpermission_matcherpermission_channeldecision_ref
Executionexecution_profile_reftimeout_msabort_semanticsprogress_schemacontext_modifier_policy
Resultresult_mappermax_inline_charspersistence_policy_refempty_result_policyredaction_policy_refs
Renderingui_summaryactivity_descriptionprogress_render_hintrejected_render_hinterror_render_hinttranscript_search_text

Fail-closed defaults

如果实现提供默认值,SHOULD 保守:

缺失字段安全默认值
is_concurrency_safefalse
is_read_onlyfalse
is_destructivefalse,除非明确检测到
is_open_worldnetwork/browser/shell 默认 true,除非有明确 scope
requires_user_interactionfalse
strictprovider 支持时,结构化 model-facing tools 默认 true
interrupt_behaviorblock
classifier_input空字符串;安全相关工具必须覆盖

内部可信工具可以使用更宽松默认值,但导出的 Agent Tool record 仍应说明哪些事实是推断出来的。

Model schema vs runtime schema

Model-facing schema SHOULD 只包含模型可以生成的字段。Runtime schema MAY 包含由 hooks、permission prompts、migration layers 或 adapters 注入的内部字段。Internal-only fields MUST 标记 visibility: "internal",使用时记录 mutation_source

Rendering boundary

Tool interface 可以提供 UI hints,但 Agent Tool 不定义 UI component。应区分:

  • model-facing result serialization。
  • UI-facing progress 或 result projection。
  • transcript/search text。
  • persisted payload preview。
  • artifact 或 resource refs。

这种分离避免 large result wrapper、UI-only label 或 collapsed view 变成 canonical tool output。

Draft standard for portable agent tool declarations, runtime interfaces, invocations, progress, results, permissions, scheduling, and audit refs.