Class McpSnmpEncodeBER
java.lang.Object
org.snmp4j.mcp.tool.snmp.ber.McpSnmpEncodeBER
- All Implemented Interfaces:
McpTool
MCP tool that encodes a BER node tree — expressed in the same JSON format that
snmp_message_ber emits — back into raw message bytes, with optional fault
injection, declarative mutations and computed permutations. The hex output is designed to be
fed to snmp_send_raw.
The tool composes BerJsonEncoder (node tree → bytes, including invalid
encodings) with BerMutations (JSON-Pointer edits and permutation sweeps), enabling an
MCP client to systematically fuzz an SNMP agent: corrupt tags, forge lengths, truncate fields,
flip bits, and sweep values/ranges across one or more elements.
- Since:
- 0.1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecutes the tool with the provided parameters.io.modelcontextprotocol.spec.McpSchema.ToolAnnotationsGets the tool annotations.Gets the description for this tool.static StringReturns the JSON Schema (Draft 2020-12) for the object returned by 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.
-
Field Details
-
TOOL_ID
Tool ID registered with the MCP server ("snmp_encode_ber").- See Also:
-
ENCODE_BER_RESULT_SCHEMA_RESOURCE_URI
MCP resource URI for the result JSON schema.- See Also:
-
-
Constructor Details
-
McpSnmpEncodeBER
public McpSnmpEncodeBER()Creates a new BER encode/mutate tool.
-
-
Method Details
-
getId
-
getName
-
getVersion
Description copied from interface:McpToolGets the version of this tool.- Specified by:
getVersionin interfaceMcpTool- Returns:
- the tool version
-
getTitle
-
getAnnotation
public io.modelcontextprotocol.spec.McpSchema.ToolAnnotations getAnnotation()Description copied from interface:McpToolGets the tool annotations. By default, readOnly, hidden, idempotent, openWorld are true while destructive and returnDirect are false.- Specified by:
getAnnotationin interfaceMcpTool- Returns:
McpSchema.ToolAnnotations
-
getDescription
Description copied from interface:McpToolGets the description for this tool.- Specified by:
getDescriptionin interfaceMcpTool- Returns:
- the tool description
-
isAvailable
public boolean isAvailable()Description copied from interface:McpToolChecks if the tool is available in the current environment.- Specified by:
isAvailablein interfaceMcpTool- Returns:
- true if the tool is available, false otherwise
-
getRequiredContexts
Description copied from interface:McpToolGets the contexts that this tool requires.- Specified by:
getRequiredContextsin interfaceMcpTool- Returns:
- a list of required context IDs
-
getParameters
Description copied from interface:McpToolGets the supported parameters for this tool.- Specified by:
getParametersin interfaceMcpTool- Returns:
- a list of parameter descriptions
-
execute
Description copied from interface:McpToolExecutes the tool with the provided parameters.- Specified by:
executein interfaceMcpTool- Parameters:
params- the parameters to use- Returns:
- the result of the execution
- Throws:
McpToolException- if the tool execution fails
-
getEncodeBerResultSchemaJson
Returns the JSON Schema (Draft 2020-12) for the object returned by this tool.- Returns:
- JSON Schema string
-