Custom Tool's parameters doesn't support object type. #6144

Closed
opened 2026-02-21 18:14:16 -05:00 by yindo · 1 comment
Owner

Originally created by @Dofine-dufei on GitHub (Oct 17, 2024).

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

0.9.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1.set parameter type as object in Custom Tool's schema.
2.test or generate a agent, found that parameter changed to a string type.

✔️ Expected Behavior

I wish tool's parameters support object type in Custom Tool.

Actual Behavior

The tool's parameters changed to string type, actually it's object type.

Originally created by @Dofine-dufei on GitHub (Oct 17, 2024). ### 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 0.9.2 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1.set parameter type as object in Custom Tool's schema. 2.test or generate a agent, found that parameter changed to a string type. ### ✔️ Expected Behavior I wish tool's parameters support object type in Custom Tool. ### ❌ Actual Behavior The tool's parameters changed to string type, actually it's object type.
yindo added the 🐞 bug label 2026-02-21 18:14:16 -05:00
yindo closed this issue 2026-02-21 18:14:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 17, 2024):

There is a known issue where the Custom Tool's parameters change from object type to string type when set in the schema. This behavior is due to the ToolParameterConverter class's get_parameter_type method, which maps several parameter types, including ToolParameter.ToolParameterType.STRING, ToolParameter.ToolParameterType.SECRET_INPUT, and ToolParameter.ToolParameterType.SELECT, to the string type. This mapping is likely done to standardize these parameter types as strings within the schema [1].

Currently, there is no documentation or code comments explaining why object types are not supported as parameters in custom tools, nor are there any existing workarounds or extensions in the Dify codebase that allow for object types to be used as parameters in custom tools [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 17, 2024): <!-- Answer --> There is a known issue where the Custom Tool's parameters change from object type to string type when set in the schema. This behavior is due to the `ToolParameterConverter` class's `get_parameter_type` method, which maps several parameter types, including `ToolParameter.ToolParameterType.STRING`, `ToolParameter.ToolParameterType.SECRET_INPUT`, and `ToolParameter.ToolParameterType.SELECT`, to the string type. This mapping is likely done to standardize these parameter types as strings within the schema <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/tools/utils/tool_parameter_converter.py)</sup>. Currently, there is no documentation or code comments explaining why object types are not supported as parameters in custom tools, nor are there any existing workarounds or extensions in the Dify codebase that allow for object types to be used as parameters in custom tools <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/tools/utils/tool_parameter_converter.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6144