Skip to content

The mcpPrompt parameter cannot be mounted #4

@TheEterna

Description

@TheEterna

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions