Summary
A prompt route parameter is listed as optional in prompts/list, but prompts/get without the argument fails validation.
Reproduction
Minimal prerelease sample:
app.Map("ops troubleshoot {symptom}", static (string symptom) =>
$"Investigate this symptom: '{symptom}'.")
.WithDescription("Generate troubleshooting instructions for an agent.")
.AsPrompt();
Using Repl.Mcp 0.11.0-dev.56 with MCP Inspector CLI:
npx --yes @modelcontextprotocol/inspector --cli ./run-mcp.sh --method prompts/list
Observed:
{
"name": "ops_troubleshoot",
"arguments": [
{
"name": "symptom",
"description": "Observed symptom",
"required": false
}
]
}
Then:
npx --yes @modelcontextprotocol/inspector --cli ./run-mcp.sh \
--method prompts/get \
--prompt-name ops_troubleshoot
fails with:
Missing value for parameter 'symptom' (expected: string).
Providing the argument works:
npx --yes @modelcontextprotocol/inspector --cli ./run-mcp.sh \
--method prompts/get \
--prompt-name ops_troubleshoot \
--prompt-args symptom="queue depth rising"
Expected behavior
prompts/list metadata and invocation validation should agree.
Possible directions:
- mark route arguments as required if the MCP spec/client behavior allows it;
- make prompt route parameters optional at execution time;
- reject/diagnose
.AsPrompt() routes that require positional route parameters unless defaults/optional segments are used.
Notes from source inspection
ReplMcpServerPrompt currently sets prompt argument metadata with:
Required = false // MCP spec: all prompt arguments must be optional.
but invocation still dispatches through the normal Repl route, where {symptom} is required.
Environment observed
- Repl.Mcp:
0.11.0-dev.56
- .NET SDK:
10.0.301
- OS: Ubuntu 24.04 linux-x64
Summary
A prompt route parameter is listed as optional in
prompts/list, butprompts/getwithout the argument fails validation.Reproduction
Minimal prerelease sample:
Using Repl.Mcp
0.11.0-dev.56with MCP Inspector CLI:Observed:
{ "name": "ops_troubleshoot", "arguments": [ { "name": "symptom", "description": "Observed symptom", "required": false } ] }Then:
fails with:
Providing the argument works:
npx --yes @modelcontextprotocol/inspector --cli ./run-mcp.sh \ --method prompts/get \ --prompt-name ops_troubleshoot \ --prompt-args symptom="queue depth rising"Expected behavior
prompts/listmetadata and invocation validation should agree.Possible directions:
.AsPrompt()routes that require positional route parameters unless defaults/optional segments are used.Notes from source inspection
ReplMcpServerPromptcurrently sets prompt argument metadata with:but invocation still dispatches through the normal Repl route, where
{symptom}is required.Environment observed
0.11.0-dev.5610.0.301