Skip to content

duplicate issue: toolInput cannot be null or empty #4007

@johnyannj

Description

@johnyannj

Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create.
If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:

Bug description
when method tool or mcp tool with no argument and calling in stream mode, errors will occur.

method tool:
java.lang.IllegalArgumentException: toolInput cannot be null or empty
at org.springframework.util.Assert.hasText(Assert.java:253)
at org.springframework.ai.tool.method.MethodToolCallback.call(MethodToolCallback.java:99)
at org.springframework.ai.model.tool.DefaultToolCallingManager.lambda$executeToolCall$5(DefaultToolCallingManager.java:220)
at io.micrometer.observation.Observation.observe(Observation.java:564)
at org.springframework.ai.model.tool.DefaultToolCallingManager.executeToolCall(DefaultToolCallingManager.java:217)
at

mcp tool:
java.lang.RuntimeException: java.lang.IllegalArgumentException: argument "content" is null
at org.springframework.ai.model.ModelOptionsUtils.jsonToMap(ModelOptionsUtils.java:107)
at org.springframework.ai.model.ModelOptionsUtils.jsonToMap(ModelOptionsUtils.java:92)
at org.springframework.ai.mcp.SyncMcpToolCallback.call(SyncMcpToolCallback.java:113)
at org.springframework.ai.mcp.SyncMcpToolCallback.call(SyncMcpToolCallback.java:126)
at org.springframework.ai.model.tool.DefaultToolCallingManager.lambda$executeToolCall$5(DefaultToolCallingManager.java:224)

Environment
spring ai 1.0.1
vllm(may be is a reason)

Related issues

#3864
#3290
#3234
#3248
#3280
#2417

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions