Table of Contents

Method GetPromptsAsync

Namespace
LMKit.Mcp.Client
Assembly
LM-Kit.NET.dll

GetPromptsAsync(CancellationToken)

Retrieves the server's prompt catalog. Results are cached after the first call until invalidation or a manual refresh via RefreshPromptsAsync(CancellationToken).

public Task<IReadOnlyCollection<McpPrompt>> GetPromptsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<IReadOnlyCollection<McpPrompt>>

A read-only collection of McpPrompt values.

Exceptions

ObjectDisposedException

Thrown if the client has been disposed.

HttpRequestException

Thrown on HTTP/JSON-RPC errors or malformed payloads.