You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VAPI无法读取n8n工作流返回的工具调用结果问题

VAPI工具调用结果无法被AI读取的问题

我在VAPI中创建了一个名为disponibilidad_tool的工具调用函数,通过n8n工作流查询可用日期。n8n工作流运行正常并能返回可用日期,但VAPI中的AI无法读取或使用该响应。

我发送给VAPI的请求内容:

{
  "name": "disponibilidad_tool",
  "role": "tool_call_result",
  "result": {
    "disponibilidad": false,
    "alternativas": [ "{{ $json.response.result.new_date[0] }}" ] // 此处为可用日期,通常为单个条目
  },
  "toolCallId": "{{ $('Webhook').first().json.body.message.toolCalls[0].id }}"
}

VAPI实际接收到的响应内容:

{
  "name": "disponibilidad_tool",
  "role": "tool_call_result",
  "time": 1750086569063,
  "result": "Success.", // 此处应包含可用日期等更多信息,但实际没有
  "toolCallId": "call_H7ay2CXXXX1ALjCEZ25XXXXX",
  "secondsFromStart": 24.924
} 

已尝试的解决方案:

  • 仅发送包含日期的简单JSON:
{"alternativas":"2025-06-16"}
  • 尝试将必要数据放入result字段的标准JSON结构:
"result": {
    "disponibilidad": false,
    "alternativas": [ "{{ $json.response.result.new_date[0] }}" ]
}
  • 将结果与备选日期分开传递:
"result": false,
"alternativas": [ "{{ $json.response.result.new_date[0] }}" ]

内容的提问来源于stack exchange,提问作者Polina Demina

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 21:23:26