Method GetPromptsAsync
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
cancellationTokenCancellationTokenA 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.