How do prompt arguments work, and how does a client discover them?
Quick Answer
Each prompt declares an arguments array in its prompts/list entry — each argument has a name, a description, and a required flag, but (unlike tool inputSchema) no full JSON Schema type system; argument values are always strings. A client discovers a prompt's arguments by reading this array (often to render a form or fill-in-the-blank UI before invoking it), then calls prompts/get with {name, arguments: {...}}, and the server substitutes those values into its template to produce the final set of messages. Because arguments are meant for direct human entry (a slash command's parameters) rather than model-generated structured data, the simpler string-only model is intentional — it avoids requiring a full schema validator just to fill in a template.
Detailed Answer
Prompt arguments look superficially similar to tool arguments, but the design intentionally diverges once you look closely.
Discovering arguments
// prompts/list result
{"prompts": [{
"name": "code-review",
"description": "Review a code diff against team standards.",
"arguments": [
{"name": "diff", "description": "The unified diff to review", "required": true},
{"name": "strictness", "description": "'lenient' or 'strict'", "required": false}
]
}]}
Invoking with arguments
{"method": "prompts/get", "params": {
"name": "code-review",
"arguments": {"diff": "diff --git a/app.py ...", "strictness": "strict"}
}}
Why simple strings, not JSON Schema
Tool inputSchema needs real typing — numbers, enums, nested objects — because a model fills it in while reasoning about structured data. Prompt arguments are designed to be filled in by a human, often typing directly into a slash-command-style text field, or through a simple host-rendered form. A flat string-keyed map with just a name, description, and required flag is enough for that. It keeps prompt definitions lightweight — you don't need a schema validator just to render a fill-in-the-blank template.
What the host is responsible for
Because argument metadata is intentionally light, hosts commonly render a basic form UI from the arguments array: one text field per argument, required ones marked. They collect values from the user and pass them straight through as strings in the prompts/get call. There's no expectation of client-side type coercion, only a check that required fields are present.