Primitives

Prompts: list and get

Two calls again: one fills the slash menu, the other turns a command into messages.

1 List what's available

prompts/list → resultjson
{  "prompts": [{    "name": "explain",    "title": "Explain a sum",    "description": "Work out a sum step by step.",    "arguments": [{ "name": "expression", "required": true }]  }]}

The host builds its menu from this: name for the command, title and description for the label, arguments for what to ask.

2 Get the messages

host → serverjson
{  "method": "prompts/get",  "params": {    "name": "explain",    "arguments": { "expression": "48213+97356" }  }}
prompts/get → resultjson
{  "messages": [{    "role": "user",    "content": {      "type": "text",      "text": "Add 48213+97356 with the add tool."    }  }]}
A prompt's messages can also embed resources, so a template can bring live context with it. The model only sees the final messages, never the template.

13 / 28