Interface CompletionResult
- All Superinterfaces:
HasMeta
Completion candidates for a single argument, per the MCP
completion/complete result
shape. The spec caps a response at 100 values; the dispatcher truncates and forces
hasMore=true if a function returns more.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletionResult.Builderbuilder()Creates a new builder forCompletionResult.static CompletionResultempty()An empty completion result with no candidates, unknown total, and no more results.@Nullable BooleanhasMore()Whether additional results exist beyondvalues().meta()Optional protocol extension metadata.static CompletionResultCreates a result with candidate values and no total/hasMore metadata.static CompletionResultCreates a result with candidate values and total/hasMore metadata.@Nullable Longtotal()The total number of matches, if known.values()Candidate values ranked by relevance.
-
Method Details
-
values
Candidate values ranked by relevance. -
total
@Nullable Long total()The total number of matches, if known. -
hasMore
@Nullable Boolean hasMore()Whether additional results exist beyondvalues(). -
meta
Optional protocol extension metadata. -
empty
An empty completion result with no candidates, unknown total, and no more results. -
of
Creates a result with candidate values and no total/hasMore metadata. -
of
Creates a result with candidate values and total/hasMore metadata. -
builder
Creates a new builder forCompletionResult.
-