Table of Contents

Class PromptArgument

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents an argument that a prompt can accept for templating and customization.

public sealed class PromptArgument : IBaseMetadata
Inheritance
PromptArgument
Implements
Inherited Members

Remarks

The PromptArgument class defines metadata for arguments that can be provided to a prompt. These arguments are used to customize or parameterize prompts when they are retrieved using PromptsGet requests.

See the schema for details.

Properties

Description

Gets or sets a human-readable description of the argument's purpose and expected values.

[JsonPropertyName("description")]
public string? Description { get; set; }

Property Value

string

Remarks

This description helps developers understand what information should be provided for this argument and how it will affect the generated prompt.

Name

Gets or sets the unique identifier for this item.

[JsonPropertyName("name")]
public required string Name { get; set; }

Property Value

string

Required

Gets or sets an indication as to whether this argument must be provided when requesting the prompt.

[JsonPropertyName("required")]
public bool? Required { get; set; }

Property Value

bool?

Remarks

When set to true, the client must include this argument when making a PromptsGet request. If a required argument is missing, the server should respond with an error.

Title

Gets or sets a title.

[JsonPropertyName("title")]
public string? Title { get; set; }

Property Value

string

Remarks

This is intended for UI and end-user contexts. It is optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology. If not provided, Name may be used for display (except for tools, where Title, if present, should be given precedence over using Name).