Interface McpResourceHandler
Programmatic MCP resource-read handler contract.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionProvides optional description metadata for the resource.Provides the MIME type returned by this resource handler.getName()Provides the MCP resource name.getUri()Provides the resource URI or URI template handled by this resource.handle(@NonNull McpResourceHandlerContext context) Handles an MCPresources/readrequest.
-
Method Details
-
getUri
-
getName
-
getMimeType
Provides the MIME type returned by this resource handler.- Returns:
- the MIME type
-
getDescription
Provides optional description metadata for the resource.- Returns:
- the resource description, if available
-
handle
Handles an MCPresources/readrequest.- Parameters:
context- the resource handler context- Returns:
- the resource contents
- Throws:
Exception- if the resource read fails
-