Interface McpContext

All Known Implementing Classes:
ModelRepositoryContext, SnmpAgentContext

public interface McpContext
Interface for contexts that can be registered with the MCP server. Contexts provide data or environments that tools can operate within.
Since:
0.0.1
Version:
0.1.0
Author:
SNMP4J.org
  • Method Details

    • getId

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

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

      String getDescription()
      Gets the description for this context.
      Returns:
      the context description
    • initialize

      void initialize(Map<String,Object> config) throws McpContextException
      Initializes the context with the given configuration.
      Parameters:
      config - the configuration to use
      Throws:
      McpContextException - if initialization fails
    • close

      void close()
      Releases any resources used by this context.
    • getValue

      Object getValue(String key)
      Gets a value from the context.
      Parameters:
      key - the key to look up
      Returns:
      the value associated with the key, or null if not found
    • setValue

      void setValue(String key, Object value)
      Sets a value in the context.
      Parameters:
      key - the key to set
      value - the value to associate with the key
    • isReady

      boolean isReady()
      Checks if the context is ready for use.
      Returns:
      true if the context is ready, false otherwise
    • getDependentContextIds

      String[] getDependentContextIds()
      Gets any dependent contexts that this context requires.
      Returns:
      an array of required context IDs