spring-projects / spring-projects/spring-ai

duplicate issue: toolInput cannot be null or empty

Open
#4,007 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.