Skip to content
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

Support multiple prompt arguments #21944

Open
1 task done
strowk opened this issue Dec 12, 2024 · 0 comments
Open
1 task done

Support multiple prompt arguments #21944

strowk opened this issue Dec 12, 2024 · 0 comments
Labels
admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue

Comments

@strowk
Copy link
Contributor

strowk commented Dec 12, 2024

Check for existing issues

  • Completed

Describe the feature

MCP prompts could take more than one argument.
Zed filters out those here:

if let Some(prompts) = protocol.list_prompts().await.log_err() {

/// MCP servers can return prompts with multiple arguments. Since we only
/// support one argument, we ignore all others. This is the necessary predicate
/// for this.
pub fn acceptable_prompt(prompt: &Prompt) -> bool {
match &prompt.arguments {
None => true,
Some(args) if args.len() <= 1 => true,
_ => false,
}
}

This creates a certain confusion for anyone who tries to work with this system. There is no indication in system whatsoever that prompts were removed (not even in debug log), nor there exits any documentation explaining that behavior.
More than that, this design would result in strange incompatibilities, when MCP server has updated and added new functionality by taking more optional arguments, and cause functionality for Zed users to break.

The best thing to do seems to support more than one parameter for prompts. Since prompts appear to me sort of like command lines in shells, there does not seem to be any necessity to only take one argument. Certain confusion could appear over that in which order arguments follow each other (i.e which it is that user has started typing), but since arguments at least in MCP are defined as an array (from promts/list), the order of things in it could be assumed to be the order in which arguments are most sensibly entered. Additional hint as to name of entered argument could also be inserted in chat after prompt is resolved (f.e after user typed it completely and entered space or Tabbed it in).
Any necessary spaces could be passed same way they are escaped in shells - by using quotes or backslash.

Environment

Zed: v0.164.2 (Zed)
OS: Linux X11 ubuntu 24.04
Memory: 60.6 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV GFX1103_R1) || radv || Mesa 24.0.9-0ubuntu0.2

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@strowk strowk added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue
Projects
None yet
Development

No branches or pull requests

1 participant