-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
Due to the default behavior of JVM compilation, which does not retain the original variable name but instead replaces it with the format arg0, arg1..., the - parameters parameter needs to be added to preserve the original variable name. This has led to a bug in the following code of the buildArgs method of the AbstractMcpPromptMethodcallbacks class:
// For individual argument parameters, extract from the request arguments
// problem point
String paramName = param.getName();
if (request.arguments() != null && request.arguments().containsKey(paramName)) {
Object argValue = request.arguments().get(paramName);
args[i] = convertArgumentValue(argValue, paramType);
}
I think it should be modified to:
// For individual argument parameters, extract from the request arguments
String paramName = param.getAnnotation(McpArg.class).name();
if (request.arguments() != null && request.arguments().containsKey(paramName)) {
Object argValue = request.arguments().get(paramName);
args[i] = convertArgumentValue(argValue, paramType);
}
Metadata
Metadata
Assignees
Labels
No labels