addTool

fun addTool(tool: KFunction<*>): Boolean

Dynamically adds a new tool to the server at runtime and sends a ToolListChangedNotification

Return

true if the tool was added, false if it was already present.

Parameters

tool

The @McpTool-annotated function reference.