Interface McpTool
- All Known Implementing Classes:
GetMibFileTool, McpMibSemanticSearch, McpSnmpCommandGenerator, McpSnmpEncodeBER, McpSnmpMessageBER, McpSnmpModuleSupport, McpSnmpSendRaw, McpSnmpTable, McpSnmpTree, MibBrowserTool, MibCompilerTool, MibSearchTool, SnmpSet
public interface McpTool
Interface for tools that can be registered with the MCP server.
Tools provide specific functionality that can be executed by the server.
- Since:
- 0.0.1
- Version:
- 0.1.0
- Author:
- SNMP4J.org
-
Method Summary
Modifier and TypeMethodDescriptionExecutes the tool with the provided parameters.default io.modelcontextprotocol.spec.McpSchema.ToolAnnotationsGets the tool annotations.Gets the description for this tool.getId()Gets the unique identifier for this tool.getName()Gets the display name for this tool.Gets the supported parameters for this tool.Gets the contexts that this tool requires.getTitle()Gets the title associated with this tool.Gets the version of this tool.booleanChecks if the tool is available in the current environment.
-
Method Details
-
getId
-
getName
-
getDescription
-
getVersion
-
getParameters
List<ToolParameter> getParameters()Gets the supported parameters for this tool.- Returns:
- a list of parameter descriptions
-
execute
Executes the tool with the provided parameters.- Parameters:
params- the parameters to use- Returns:
- the result of the execution
- Throws:
McpToolException- if the tool execution fails
-
isAvailable
boolean isAvailable()Checks if the tool is available in the current environment.- Returns:
- true if the tool is available, false otherwise
-
getRequiredContexts
-
getTitle
-
getAnnotation
default io.modelcontextprotocol.spec.McpSchema.ToolAnnotations getAnnotation()Gets the tool annotations. By default, readOnly, hidden, idempotent, openWorld are true while destructive and returnDirect are false.- Returns:
McpSchema.ToolAnnotations
-