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 Summary
Modifier and TypeMethodDescriptionvoidclose()Releases any resources used by this context.String[]Gets any dependent contexts that this context requires.Gets the description for this context.getId()Gets the unique identifier for this context.getName()Gets the display name for this context.Gets a value from the context.voidinitialize(Map<String, Object> config) Initializes the context with the given configuration.booleanisReady()Checks if the context is ready for use.voidSets a value in the context.
-
Method Details
-
getId
-
getName
-
getDescription
-
initialize
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
-
setValue
-
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
-