Package org.forgerock.openig.mcp
Class McpContext.McpServerResponse
java.lang.Object
org.forgerock.openig.mcp.McpContext.McpServerResponse
- Enclosing class:
McpContext
A helper object for working with a valid MCP Server response.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the error code if this response represents an error response, otherwise 0.Returns the error message if this response represents an error response, otherwise null.id()Returns the ID of the response, can be either a number or a String.booleanisError()Returns true if this response represents an error response.booleanReturns true if this response is in response to an initialize request.Returns the server name if this is a response to an initialize request, otherwise null.Returns the server version if this is a response to an initialize request, otherwise null.
-
Method Details
-
id
Returns the ID of the response, can be either a number or a String.- Returns:
- the ID of the response, can be either a number or a String
-
isError
public boolean isError()Returns true if this response represents an error response.- Returns:
- true if this response represents an error response
-
errorCode
public int errorCode()Returns the error code if this response represents an error response, otherwise 0.- Returns:
- the error code if this response represents an error response, otherwise 0
-
errorMessage
Returns the error message if this response represents an error response, otherwise null.- Returns:
- the error message if this response represents an error response, otherwise null
-
serverName
Returns the server name if this is a response to an initialize request, otherwise null.- Returns:
- the server name if this is a response to an initialize request, otherwise null
-
serverVersion
Returns the server version if this is a response to an initialize request, otherwise null.- Returns:
- the server version if this is a response to an initialize request, otherwise null
-
isInitialize
public boolean isInitialize()Returns true if this response is in response to an initialize request.- Returns:
- true if this response is in response to an initialize request
-