Table of Contents

Method GetPromptAsync

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

GetPromptAsync(string, IDictionary<string, object>, CancellationToken)

Retrieves a fully rendered prompt by name via prompts/get.

public Task<McpPromptResult> GetPromptAsync(string name, IDictionary<string, object> arguments = null, CancellationToken cancellationToken = default)

Parameters

name string

The prompt name to render.

arguments IDictionary<string, object>

Optional argument map to pass to the prompt.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<McpPromptResult>

An McpPromptResult containing chat messages and optional description.

Exceptions

ArgumentException

Thrown when name is null or whitespace.

ObjectDisposedException

Thrown if the client has been disposed.

HttpRequestException

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