spring-projects / spring-projects/spring-ai

ToolCallbacks.from(objects) can not deal with a proxy bean

Open
#2,745 2 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

ToolCallbacks can not get tools from the proxy bean with the following code

@SpringBootApplication
public class McpServerApplication {
    public static void main(String[] args) {
        org.springframework.boot.SpringApplication.run(McpServerApplication.class, args);
    }


    @Bean
    public ToolCallbackProvider myTools() {
        return ToolCallbackProvider.from(ToolCallbacks.from(this));
    }
    @Tool(description = "get weather")
    public String test(String address) {
        return "address: " + address  + " is cloudy";
    }
}

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 at ToolCallbacks.from(Object) and reproduce the issue with the McpServerApplication example, focusing on the proxy bean passed through ToolCallbackProvider.from. Done means the @Tool method on the proxy bean is discovered and exposed as a callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.