Skip to content

Include PromptType and Prompt attributes #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aaronpowell opened this issue Mar 23, 2025 · 0 comments · Fixed by #126
Closed

Include PromptType and Prompt attributes #70

aaronpowell opened this issue Mar 23, 2025 · 0 comments · Fixed by #126
Assignees
Labels
enhancement New feature or request

Comments

@aaronpowell
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The API for McpToolType and McpTool (combined with the WithTools method) makes it really easy to define tools. It'd be great to have a comparable API for Prompts.

Describe the solution you'd like
I'd like to be able to have code like this:

[PromptType]
public static class SamplePrompt {
  [Prompt, Description("This is a sample prompt")]
  public static string Sample() => "Some sample prompt";
}

// in program.cs
builder.Services
    .AddMcpServer()
    .WithStdioServerTransport()
    .WithTools()
    .WithPrompts();

Describe alternatives you've considered
Currently, the only solution would be to implement this via WithListPromptsHandler and WithGetPromptHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants