Interface McpResourceHandlerContext
Context supplied to programmatic MCP resource handlers.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves an endpoint path parameter as a string.getEndpointPathParameter(@NonNull String name, @NonNull Class<T> type) Retrieves an endpoint path parameter using a Soklet value conversion.Provides the underlying request context.Provides the concrete resource URI requested by the client.Provides the current session context.getUriParameter(@NonNull String name) Retrieves a URI-template parameter as a string.getUriParameter(@NonNull String name, @NonNull Class<T> type) Retrieves a URI-template parameter using a Soklet value conversion.
-
Method Details
-
getRequestContext
Provides the underlying request context.- Returns:
- the request context
-
getSessionContext
Provides the current session context.- Returns:
- the session context
-
getRequestedUri
Provides the concrete resource URI requested by the client.- Returns:
- the requested resource URI
-
getUriParameter
-
getUriParameter
Retrieves a URI-template parameter using a Soklet value conversion.- Type Parameters:
T- the converted type- Parameters:
name- the URI parameter nametype- the desired converted type- Returns:
- the converted parameter value, if present
-
getEndpointPathParameter
-
getEndpointPathParameter
Retrieves an endpoint path parameter using a Soklet value conversion.- Type Parameters:
T- the converted type- Parameters:
name- the endpoint path parameter nametype- the desired converted type- Returns:
- the converted parameter value, if present
-