spring-projects / spring-projects/spring-ai

feat: Provide Toolname to ToolContextToMcpMetaConverter.convert

Open
#4,958 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, the feature you are about to request might have already been requested.

Expected Behavior

The ToolContextToMcpMetaConverter.convert method should take a new parameter String toolName in order to convert the ToolContext based on name of the called tool.

Map<String, Object> convert(ToolContext toolContext, String toolName);

When calling this method (e.g. in SyncMcpToolCallback.call method), this information is present:

var mcpMeta = toolContext != null ? this.toolContextToMcpMetaConverter.convert(toolContext, this.tool.name()) : null;

This allows me to set the MCP meta based on the name of the called tool.

Current Behavior

Currently, the ToolContextToMcpMetaConverter.convert method only takes the ToolContext as parameter.

Map<String, Object> convert(ToolContext toolContext);

Context

When calling a MCP tool I want to make sure to pass only values to the MCP meta that are relevant for the given MCP tool.

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

Locate ToolContextToMcpMetaConverter and the SyncMcpToolCallback.call method mentioned in the issue, then inspect all callers and implementations of convert. Update the conversion path so the called tool name is available, and verify that MCP metadata can be selected based on that name without breaking existing callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.