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 Details

    • getId

      String getId()
      Gets the unique identifier for this tool.
      Returns:
      the tool ID
    • getName

      String getName()
      Gets the display name for this tool.
      Returns:
      the tool name
    • getDescription

      String getDescription()
      Gets the description for this tool.
      Returns:
      the tool description
    • getVersion

      String getVersion()
      Gets the version of this tool.
      Returns:
      the tool version
    • getParameters

      List<ToolParameter> getParameters()
      Gets the supported parameters for this tool.
      Returns:
      a list of parameter descriptions
    • execute

      ToolResult execute(Map<String,Object> params) throws McpToolException
      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

      List<String> getRequiredContexts()
      Gets the contexts that this tool requires.
      Returns:
      a list of required context IDs
    • getTitle

      String getTitle()
      Gets the title associated with this tool.
      Returns:
      the tool title
    • 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