Table of Contents

Class McpServerPromptCreateOptions

Namespace
ModelContextProtocol.Server
Assembly
ModelContextProtocol.Core.dll

Provides options for controlling the creation of an McpServerPrompt.

public sealed class McpServerPromptCreateOptions
Inheritance
McpServerPromptCreateOptions
Inherited Members

Remarks

These options allow for customizing the behavior and metadata of prompts created with McpServerPrompt.Create. They provide control over naming, description, and dependency injection integration.

When creating prompts programmatically rather than using attributes, these options provide the same level of configuration flexibility.

Properties

Description

Gets or set the description to use for the McpServerPrompt.

public string? Description { get; set; }

Property Value

string

Remarks

If null, but a DescriptionAttribute is applied to the method, the description from that attribute will be used.

Name

Gets or sets the name to use for the McpServerPrompt.

public string? Name { get; set; }

Property Value

string

Remarks

If null, but an McpServerPromptAttribute is applied to the method, the name from the attribute will be used. If that's not present, a name based on the method's name will be used.

SchemaCreateOptions

Gets or sets the JSON schema options when creating Microsoft.Extensions.AI.AIFunction from a method.

public AIJsonSchemaCreateOptions? SchemaCreateOptions { get; set; }

Property Value

AIJsonSchemaCreateOptions

Remarks

Defaults to Microsoft.Extensions.AI.AIJsonSchemaCreateOptions.Default if left unspecified.

SerializerOptions

Gets or sets the JSON serializer options to use when marshalling data to/from JSON.

public JsonSerializerOptions? SerializerOptions { get; set; }

Property Value

JsonSerializerOptions

Remarks

Defaults to DefaultOptions if left unspecified.

Services

Gets or sets optional services used in the construction of the McpServerPrompt.

public IServiceProvider? Services { get; set; }

Property Value

IServiceProvider

Remarks

These services will be used to determine which parameters should be satisifed from dependency injection. As such, what services are satisfied via this provider should match what's satisfied via the provider passed in at invocation time.