Interface McpSkillVariantSelector
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Only accessible, discoverable registrations are supplied. Return one exact
supplied registration instance, not an equal copy, or omit the group with
Optional.empty(). A foreign registration, null result, or callback
failure fails listing without publishing a partial result. Selection grants
no access; direct URI lookup bypasses it and independently rechecks access.
A configured selector runs for every nonempty filtered group, including a singleton. Empty filtered groups do not invoke it. Declared multivariant groups require an explicit selector, even if filtering leaves one candidate. The application owns fallback selection and must respect the supplied bounded language preferences, including zero-weight exclusions. The existing localization context is available through invocation features rather than a separate negotiation; Soklet does not replace a custom selector's policy with automatic regional matching.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionselect(@NonNull McpRequestContext requestContext, @NonNull McpSkillVariantSelectionContext skillVariantSelectionContext, @NonNull McpInvocationFeatures invocationFeatures) Selects at most one of the supplied canonical registrations for listing.
-
Method Details
-
select
@NonNull Optional<@NonNull McpSkillRegistration> select(@NonNull McpRequestContext requestContext, @NonNull McpSkillVariantSelectionContext skillVariantSelectionContext, @NonNull McpInvocationFeatures invocationFeatures) throws Exception Selects at most one of the supplied canonical registrations for listing.- Parameters:
requestContext- admitted request contextskillVariantSelectionContext- group key, filtered candidates, and bounded client preferencesinvocationFeatures- invocation-scoped optional features- Returns:
- one supplied registration instance, or empty to omit the group; never null
- Throws:
Exception- if variant selection fails
-