Table of Contents

Class CompletionsCapability

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents the completions capability for providing auto-completion suggestions for prompt arguments and resource references.

public class CompletionsCapability
Inheritance
CompletionsCapability
Inherited Members

Remarks

When enabled, this capability allows a Model Context Protocol server to provide auto-completion suggestions. This capability is advertised to clients during the initialize handshake.

The primary function of this capability is to improve the user experience by offering contextual suggestions for argument values or resource identifiers based on partial input.

See the schema for details.

Properties

CompleteHandler

Gets or sets the handler for completion requests.

[JsonIgnore]
public Func<RequestContext<CompleteRequestParams>, CancellationToken, ValueTask<CompleteResult>>? CompleteHandler { get; set; }

Property Value

Func<RequestContext<CompleteRequestParams>, CancellationToken, ValueTask<CompleteResult>>

Remarks

This handler provides auto-completion suggestions for prompt arguments or resource references in the Model Context Protocol. The handler receives a reference type (e.g., "ref/prompt" or "ref/resource") and the current argument value, and should return appropriate completion suggestions.