Skip to content

Conversation

@tvallin
Copy link
Member

@tvallin tvallin commented Sep 9, 2025

Fixes #32

This PR does not impact the API, but introduce new capabilities.

For the imperative way, templates parameters can be accessed from McpParameters class:

request -> {
          String name = request.parameters()
                  .get("name")
                  .asString()
                  .orElse("Unknown");
}

For declarative, parameter can be accessed from the method parameters:

@Mcp.Resource(
          uri = "https://{path}/foo",
          description = "Description",
          mediaType = MediaTypes.TEXT_PLAIN_VALUE)
String resource4(String path) {
    return path;
}

The examples and documentation have been also updated to reflect that change.

@tvallin tvallin added this to the 1.0.0-M2 milestone Sep 9, 2025
@tvallin tvallin requested a review from spericas September 9, 2025 20:34
@tvallin tvallin self-assigned this Sep 9, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 9, 2025
@tvallin tvallin merged commit f558d3e into helidon-io:main Sep 10, 2025
11 checks passed
@tvallin tvallin deleted the resource-templates branch September 10, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Resource template to support handling of parameters

2 participants