Spring ai version: 1.0.3 Spring boot version: 3.5.6

I have a running mcp-toolbox for databases server with 3 exposed tools.

My Model dependency is spring-ai-starter-model-azure-openai.

I set default tools when creating ChatClient bean:

@Bean
ChatClient chatClient(ChatClient.Builder chatClientBuilder, ToolCallbackProvider toolCallbackProvider, ChatMemory chatMemory) {
    return chatClientBuilder
        .defaultToolCallbacks(toolCallbackProvider)
        .defaultAdvisors(MessageChatMemoryAdvisor.builder(chatMemory).build())
        .build();
  }

My service class:

@Service
@RequiredArgsConstructor
public class DefaultChatService implements ChatService {

  private final ChatClient chatClient;

  @Override
  public Flux<String> chat(ChatRequest request, String conversationId) {
    return chatClient.prompt()
        .options(prepareOptions(request))
        .user(request.message())
        .advisors(a -> a.param(ChatMemory.CONVERSATION_ID, conversationId))
        .stream()
        .content();
  }

  private ChatOptions prepareOptions(ChatRequest request) {
    ChatOptions.Builder optionsBuilder = ChatOptions.builder();
    Optional.ofNullable(request).map(ChatRequest::model).ifPresent(optionsBuilder::model);
    Optional.ofNullable(request).map(ChatRequest::temperature).ifPresent(optionsBuilder::temperature);
    return optionsBuilder.build();
  }
}

When i set options that way i expect that it overrides options set with .defaultOptions(...). But LLM can't see any tools from mcp server.

request:

list available tools

response:

Do you mean “tools” available to me in this chat (e.g., code runner, web search, file upload), or tools you have on your computer that you want me to list/describe? Could you clarify?

If you mean my capabilities in this chat, here are the kinds of “tools” / capabilities I can use or help with (depending on the platform setup): - Text generation: write emails, docs, summaries, stories, explanations. - Editing and proofreading: grammar, style, clarity, rewriting. - Code help: write, debug, explain code (many languages). - Calculation and math: arithmetic, algebra, step-by-step problem solving. - Data analysis and modeling: logic, pseudo-code, algorithm design; with file support I can analyze CSVs. - Step-by-step guides and checklists: instructions, recipes, procedures. - Brainstorming and planning: ideas, project plans, outlines, prioritization. - Translation and language help. - Research summarization: synthesize info you provide or from public knowledge I was trained on. - API and integration guidance: examples, request/response formats. - Advice and coaching: study, career, productivity (not professional/legal/medical advice). - Prompt design: for other AI tools, image or code generators.

If your platform exposes specific external tools or plugins (browser, Python sandbox, Google Drive, web search, etc.), tell me which ones you expect and I’ll list them or confirm availability. Which do you mean?

If i comment .options setting LLM can see available tools:

  @Override
  public Flux<String> chat(ChatRequest request, String conversationId) {
    return chatClient.prompt()
//        .options(prepareOptions(request))
        .user(request.message())
        .advisors(a -> a.param(ChatMemory.CONVERSATION_ID, conversationId))
        .stream()
        .content();
  }

request:

list available tools

response:

Here are the tools you can use from this session:

1) functions.spring_ai_mcp_client_toolbox_execute_sql_tool - Purpose: Execute a SQL statement. - Input (json): { "sql": "" }

2) functions.spring_ai_mcp_client_toolbox_postgres_list_tables - Purpose: Retrieve schema information for tables (simple or detailed). - Input (json) options: - output_format (string) — optional, e.g., "simple" or "detailed" - table_names (string) — optional, comma-separated table names

3) functions.spring_ai_mcp_client_toolbox_list_active_queries - Purpose: List currently running (active) PostgreSQL queries from pg_stat_activity. - Input (json) options: - exclude_application_names (string) — optional, comma-separated app names to exclude - limit (integer) — optional, max rows to return - min_duration (string) — optional, only show queries running at least this long (e.g., "1 second")

4) multi_tool_use.parallel - Purpose: Run multiple of the above tools in parallel. - Input (json): { "tool_uses": [ { "recipient_name": "functions.", "parameters": { ... } }, ... ] }

Tell me which tool you'd like to run and with what parameters.

I believe .defaultToolCallbacks shouldn't be cleared or ignored when i set .options(...)

Comment From: ilayaperumalg

@ilyakastsenevich Thanks for reporting.