spring-projects / spring-projects/spring-ai
duplicate issue: toolInput cannot be null or empty
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MethodToolCallback.java at line 99 and SyncMcpToolCallback.java at lines 113 and 126, then trace their calls through DefaultToolCallingManager in stream mode. Reproduce a no-argument method and MCP tool call on Spring AI 1.0.1; done means both cases no longer produce the reported null or empty-input exceptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100