Ch 6 — Prompts Under the Hood

Wire formats, message roles, multi-content messages, argument completion, dynamic lists, and SDK patterns
Under the Hood
-
Click play or press Space to begin...
Step- / 10
Aprompts/list Wire FormatDiscovering available prompts and their arguments
1
list
prompts/listReturns array of
prompt descriptors
each has
badge
Descriptorname, description,
arguments[]
args
2
tune
Argumentsname, description,
required flag
3
arrow_downward prompts/get: fetching rendered messages
Bprompts/get Wire FormatRendering a prompt into a message sequence
send
prompts/getname + arguments
as params
renders
forum
MessagesArray of role +
content objects
roles
4
people
Rolesuser, assistant
5
arrow_downward Multi-content messages: text + resources + images
CMulti-Content MessagesA single message can contain text, resources, and images
text_snippet
TextContentPlain text
instructions
+
attach_file
ResourceContentEmbedded resource
with URI
+
6
image
ImageContentBase64 image
data
7
arrow_downward Argument completion for prompt parameters
DArgument CompletionServer suggests values for prompt arguments
edit
User TypesPartial value
for argument
complete
auto_awesome
completionref/prompt +
argument name
returns
list
SuggestionsMatching values
for the argument
8
arrow_downward Dynamic prompt lists and list_changed
EDynamic Prompt ListsServers can add or remove prompts at runtime
playlist_add
list_changedServer notifies
prompts changed
re-list
refresh
Re-fetchClient calls
prompts/list again
update
menu
UI UpdatedSlash commands
refreshed
9
arrow_downward SDK patterns: defining prompts in code
FSDK PatternsDefining prompts in Python and TypeScript
code
Python SDK@mcp.prompt()
decorator pattern
or
10
javascript
TypeScript SDKserver.prompt()
method pattern
1
Detail