using ModelContextProtocol.Protocol;
namespace ModelContextProtocol.Server;
/// Provides an that delegates all operations to an inner .
///
/// This is recommended as a base type when building prompts that can be chained around an underlying .
/// The default implementation simply passes each call to the inner prompt instance.
///
public abstract class DelegatingMcpServerPrompt : McpServerPrompt
{
private readonly McpServerPrompt _innerPrompt;
/// Initializes a new instance of the class around the specified .
/// The inner prompt wrapped by this delegating prompt.
/// is .
protected DelegatingMcpServerPrompt(McpServerPrompt innerPrompt)
{
Throw.IfNull(innerPrompt);
_innerPrompt = innerPrompt;
}
///
public override Prompt ProtocolPrompt => _innerPrompt.ProtocolPrompt;
///
public override ValueTask GetAsync(
RequestContext request,
CancellationToken cancellationToken = default) =>
_innerPrompt.GetAsync(request, cancellationToken);
///
public override string ToString() => _innerPrompt.ToString();
}