Skip to content

chore: Add IgnoredInToolInputSchema annotation to ignore the parameter when generating the tool's input schema. #3067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

He-Pin
Copy link
Contributor

@He-Pin He-Pin commented May 9, 2025

Motivation:

Ignore the parameter when generating the input schema.

instead of #3062

…al parameter when generating tool's input schema.

Signed-off-by: 虎鸣 <hepin.p@alibaba-inc.com>
@markpollack
Copy link
Member

Can you explain the motivation for this? If you don't want a method in your @tool annotated method to be used as an argument, it just shouldn't be there in the first place? At least that is how I'm reading this... Thanks

@markpollack markpollack added this to the 1.0.x milestone May 16, 2025
@He-Pin
Copy link
Contributor Author

He-Pin commented May 16, 2025

@markpollack Thanks for looking into this. We are adding TmcpContext to the call method, so we want to ignore that type to be generated as the input schema.

public interface TmcpToolCallback extends ToolCallback {

    /**
     * @param toolInput        the input to the tool
     * @param toolContext       tool context
     * @param tmcpInputContext tmcp input context
     */
    default String call(final String toolInput,
                        final @Nullable ToolContext toolContext,
                        final TmcpInputContext tmcpInputContext) {
        if (tmcpInputContext != null && !tmcpInputContext.getContext().isEmpty()) {
            throw new UnsupportedOperationException("tmcp context is not supported!");
        }
        return call(toolInput, toolContext);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants