-
Notifications
You must be signed in to change notification settings - Fork 692
Expand file tree
/
Copy pathPrompt.cs
More file actions
78 lines (70 loc) · 2.75 KB
/
Prompt.cs
File metadata and controls
78 lines (70 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using ModelContextProtocol.Server;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents a prompt that the server offers.
/// </summary>
/// <remarks>
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </remarks>
public sealed class Prompt : IBaseMetadata
{
/// <inheritdoc />
[JsonPropertyName("name")]
public required string Name { get; set; }
/// <inheritdoc />
[JsonPropertyName("title")]
public string? Title { get; set; }
/// <summary>
/// Gets or sets an optional description of what this prompt provides.
/// </summary>
/// <remarks>
/// <para>
/// This description helps developers understand the purpose and use cases for the prompt.
/// It should explain what the prompt is designed to accomplish and any important context.
/// </para>
/// <para>
/// The description is typically used in documentation, UI displays, and for providing context
/// to client applications that may need to choose between multiple available prompts.
/// </para>
/// </remarks>
[JsonPropertyName("description")]
public string? Description { get; set; }
/// <summary>
/// Gets or sets a list of arguments that this prompt accepts for templating and customization.
/// </summary>
/// <remarks>
/// <para>
/// This list defines the arguments that can be provided when requesting the prompt.
/// Each argument specifies metadata like name, description, and whether it's required.
/// </para>
/// <para>
/// When a client makes a <see cref="RequestMethods.PromptsGet"/> request, it can provide values for these arguments
/// which will be substituted into the prompt template or otherwise used to render the prompt.
/// </para>
/// </remarks>
[JsonPropertyName("arguments")]
public IList<PromptArgument>? Arguments { get; set; }
/// <summary>
/// Gets or sets an optional list of icons for this prompt.
/// </summary>
/// <remarks>
/// This can be used by clients to display the prompt's icon in a user interface.
/// </remarks>
[JsonPropertyName("icons")]
public IList<Icon>? Icons { get; set; }
/// <summary>
/// Gets or sets metadata reserved by MCP for protocol-level metadata.
/// </summary>
/// <remarks>
/// Implementations must not make assumptions about its contents.
/// </remarks>
[JsonPropertyName("_meta")]
public JsonObject? Meta { get; set; }
/// <summary>
/// Gets or sets the callable server prompt corresponding to this metadata if any.
/// </summary>
[JsonIgnore]
public McpServerPrompt? McpServerPrompt { get; set; }
}