Failed to transform tool message: PluginInvokeError: {"error_type":"unmarshal_error","message":"unmarshal json failed: Key: 'ToolResponseChunk.Type' Error:Field validation for 'Type' failed on the 'required' tag"} #161

Closed
opened 2026-02-16 10:18:16 -05:00 by yindo · 2 comments
Owner

Originally created by @hades-plus-github on GitHub (Mar 31, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.00

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Failed to transform tool message: PluginInvokeError: {"error_type":"unmarshal_error","message":"unmarshal json failed: Key: 'ToolResponseChunk.Type' Error:Field validation for 'Type' failed on the 'required' tag"}

I get an error after running a custom tool. What does this error mean?

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @hades-plus-github on GitHub (Mar 31, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.00 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Failed to transform tool message: PluginInvokeError: {"error_type":"unmarshal_error","message":"unmarshal json failed: Key: 'ToolResponseChunk.Type' Error:Field validation for 'Type' failed on the 'required' tag"} I get an error after running a custom tool. What does this error mean? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 31, 2025):

Hey there, @hades-plus-github! 👋 I'm here to assist you with bug fixes, answer your questions, and even help you become a contributor. While you're waiting for a human maintainer, feel free to ask me anything!

There is a similar unsolved discussion regarding the error you're encountering: Failed to transform tool message: PluginInvokeError: {"error_type":"unmarshal_error","message":"unmarshal json failed: Key: 'ToolResponseChunk.Type' Error:Field validation for 'Type' failed on the 'required' tag"} [1].

The error message indicates that there is a problem with the JSON unmarshalling process, specifically related to the 'Type' field in the 'ToolResponseChunk' structure. This field is required, and the error suggests that it might be missing or incorrectly formatted in the JSON data being processed.

A common cause of 'unmarshal_error' in the Dify codebase is a data type mismatch issue. This has been noted in previous issues, particularly when using certain embeddings. It is recommended to ensure that your Dify installation and any related plugins are up to date, as updates may have addressed similar issues [2][3][4][5].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 31, 2025): <!-- Greeting --> Hey there, @hades-plus-github! 👋 I'm here to assist you with bug fixes, answer your questions, and even help you become a contributor. While you're waiting for a human maintainer, feel free to ask me anything! <!-- Answer --> There is a similar unsolved discussion regarding the error you're encountering: [Failed to transform tool message: PluginInvokeError: {"error_type":"unmarshal_error","message":"unmarshal json failed: Key: 'ToolResponseChunk.Type' Error:Field validation for 'Type' failed on the 'required' tag"}](https://github.com/langgenius/dify/discussions/17224) <sup>[[1]](https://github.com/langgenius/dify/discussions/17224)</sup>. The error message indicates that there is a problem with the JSON unmarshalling process, specifically related to the 'Type' field in the 'ToolResponseChunk' structure. This field is required, and the error suggests that it might be missing or incorrectly formatted in the JSON data being processed. A common cause of 'unmarshal_error' in the Dify codebase is a data type mismatch issue. This has been noted in previous issues, particularly when using certain embeddings. It is recommended to ensure that your Dify installation and any related plugins are up to date, as updates may have addressed similar issues <sup>[[2]](https://github.com/langgenius/dify/issues/16155)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/14501)</sup><sup>[[4]](https://github.com/langgenius/dify/issues/14624)</sup><sup>[[5]](https://github.com/langgenius/dify/issues/14708)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/18bf5d17-ba65-491a-8572-97f2871748da?feedback_type=other)</sup>
Author
Owner

@hades-plus-github commented on GitHub (Apr 1, 2025):

It's ok

@hades-plus-github commented on GitHub (Apr 1, 2025): It's ok
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#161