Class ArgumentValidator
java.lang.Object
io.github.apexdevtools.apexls.mcp.tools.ArgumentValidator
Helper class for validating common MCP tool arguments. Provides reusable validation logic for
Apex analysis tools.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContainer for validated Apex tool arguments. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractValidatedArguments(Map<String, Object> arguments) Extracts validated arguments from the argument map.static io.modelcontextprotocol.spec.McpSchema.CallToolResultvalidateApexToolArguments(Map<String, Object> arguments) Validates the standard Apex tool arguments: path, line, and offset.
-
Constructor Details
-
ArgumentValidator
public ArgumentValidator()
-
-
Method Details
-
validateApexToolArguments
public static io.modelcontextprotocol.spec.McpSchema.CallToolResult validateApexToolArguments(Map<String, Object> arguments) Validates the standard Apex tool arguments: path, line, and offset.- Parameters:
arguments- the tool arguments to validate- Returns:
- null if validation passes, or a CallToolResult with error details if validation fails
-
extractValidatedArguments
public static ArgumentValidator.ValidatedArguments extractValidatedArguments(Map<String, Object> arguments) Extracts validated arguments from the argument map. Should only be called after validateApexToolArguments() returns null.- Parameters:
arguments- the validated argument map- Returns:
- ValidatedArguments containing the extracted values
-