Class AbstractToolProvider
java.lang.Object
org.frankframework.mcp.AbstractToolProvider
- All Implemented Interfaces:
McpToolProvider
- Direct Known Subclasses:
AdapterToolProvider, ClusterMemberToolProvider, ConfigurationToolProvider, LoggingToolProvider, MessageBrowserToolProvider, ServerInfoToolProvider, TestPipelineToolProvider
Base class for
McpToolProviders. It talks to the (possibly remote) Frank!Framework Management Gateway, in the
same way the Frank!Console's FrankApiService does, and offers small helpers to declare tools, read their
arguments and turn a result (or exception) into an MCP McpSchema.CallToolResult, so that concrete providers only need to
describe the gateway request.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceThe logic behind a tool: it receives the (validated) request and produces the textual result. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.logging.log4j.Loggerprotected final OutboundGatewayprotected final McpSession -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractToolProvider(OutboundGateway outboundGateway, McpSession session) -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanbooleanArg(io.modelcontextprotocol.spec.McpSchema.CallToolRequest request, String name) protected @NonNull List<OutboundGateway.ClusterMember> All members that are part of the (Hazelcast) cluster.protected static @Nullable IntegerintegerArg(io.modelcontextprotocol.spec.McpSchema.CallToolRequest request, String name) protected static StringrequiredStringArg(io.modelcontextprotocol.spec.McpSchema.CallToolRequest request, String name) protected voidsendAsync(RequestMessageBuilder builder) Send a request without waiting for (or expecting) a response.protected @NonNull org.springframework.messaging.Message<?> sendSync(RequestMessageBuilder builder) Send a request and wait for the response.protected @NonNull StringsendSyncForString(RequestMessageBuilder builder) Send a request, wait for the response and return its payload as a String.protected static @Nullable Stringprotected io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecificationtool(String name, String description, Map<String, Object> inputSchema, AbstractToolProvider.ToolCall call) Declare a tool.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface McpToolProvider
getTools
-
Field Details
-
log
protected final org.apache.logging.log4j.Logger log -
outboundGateway
-
session
-
-
Constructor Details
-
AbstractToolProvider
-
-
Method Details
-
sendSync
Send a request and wait for the response.- Returns:
- the response message, never null
-
sendSyncForString
Send a request, wait for the response and return its payload as a String.- Returns:
- the response payload, or an empty String when the response has no content
-
sendAsync
Send a request without waiting for (or expecting) a response. -
getMembers
All members that are part of the (Hazelcast) cluster. Empty when the gateway does not support clustering. -
tool
protected io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification tool(String name, String description, Map<String, Object> inputSchema, AbstractToolProvider.ToolCall call) Declare a tool.- Parameters:
name- the unique tool name, as exposed to the MCP clientdescription- a human/LLM readable description of what the tool doesinputSchema- a JSON-schema describing the tool arguments (seeToolSchema)call- the logic that is invoked when the tool is called
-
stringArg
-
requiredStringArg
-
booleanArg
protected static boolean booleanArg(io.modelcontextprotocol.spec.McpSchema.CallToolRequest request, String name) -
integerArg
-