Class ClientToolOperations
java.lang.Object
com.mulesoft.connectors.mcp.internal.client.operation.tool.ClientToolOperations
@Throws({JsonRpcErrorTypeProvider.class,BasicOperationErrorTypeProvider.class})
public class ClientToolOperations
extends Object
Client operations to deal with tools
- Since:
- 0.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcallTool(io.modelcontextprotocol.client.McpAsyncClient client, String toolName, Map<String, Object> arguments, RequestParameterGroup requestParameters, org.mule.runtime.extension.api.runtime.process.CompletionCallback<CallToolResponse, Void> completionCallback) Invokes a tool in a remote MCP serverorg.mule.runtime.extension.api.runtime.streaming.PagingProvider<io.modelcontextprotocol.client.McpAsyncClient,ToolMetadata> Lists all the available tools in the remote MCP server
-
Constructor Details
-
ClientToolOperations
public ClientToolOperations()
-
-
Method Details
-
callTool
@DisplayName("MCP Client - Call Tool") public void callTool(@Connection io.modelcontextprotocol.client.McpAsyncClient client, @MetadataKeyId(ClientToolKeyResolver.class) String toolName, @Content(primary=true) @TypeResolver(ClientToolInputTypeResolver.class) Map<String, Object> arguments, @ParameterGroup(name="Request") RequestParameterGroup requestParameters, org.mule.runtime.extension.api.runtime.process.CompletionCallback<CallToolResponse, Void> completionCallback) Invokes a tool in a remote MCP server- Parameters:
client- the MCP clienttoolName- the name of the tool to be invokedarguments- the tool's input argumentscompletionCallback- the completion callback
-
listTools
@DisplayName("MCP Client - List Tools") public org.mule.runtime.extension.api.runtime.streaming.PagingProvider<io.modelcontextprotocol.client.McpAsyncClient,ToolMetadata> listTools()Lists all the available tools in the remote MCP server
-