Record Class McpServerFeatures.SyncResourceTemplateSpecification

java.lang.Object
java.lang.Record
io.modelcontextprotocol.server.McpServerFeatures.SyncResourceTemplateSpecification
Record Components:
resourceTemplate - The resource template definition including name, description, and parameter schema
readHandler - The function that handles resource read requests. The function's first argument is an McpSyncServerExchange upon which the server can interact with the connected client. The second arguments is a McpSchema.ReadResourceRequest. McpSchema.ResourceTemplate McpSchema.ReadResourceResult
Enclosing class:
McpServerFeatures

public static record McpServerFeatures.SyncResourceTemplateSpecification(McpSchema.ResourceTemplate resourceTemplate, BiFunction<McpSyncServerExchange,McpSchema.ReadResourceRequest,McpSchema.ReadResourceResult> readHandler) extends Record
Specification of a resource template with its synchronous handler function. Resource templates allow servers to expose parameterized resources using URI templates: URI templates.. Arguments may be auto-completed through the completion API. Templates support:
  • Parameterized resource definitions
  • Dynamic content generation
  • Consistent resource formatting
  • Contextual data injection