Ch 4 — Tools: Letting the Model Act

Discovery, invocation, annotations, progress reporting, and the full tool lifecycle
High Level
-
Click play or press Space to begin...
Step- / 8
AWhat Are Tools?Functions the model can call to take action in the real world
1
psychology
LLM DecidesModel sees tool list
and chooses to call
calls
build
Toolsearch_issues,
run_query, send_msg
returns
output
ResultText, images, or
structured data
2
arrow_downward Step 1: Discover — what tools does the server have?
BTool DiscoveryClient asks the server what tools it offers
search
tools/listClient requests
available tools
returns
list
Tool ListName, description,
input schema
injected
psychology
LLM ContextTools become part
of system prompt
3
arrow_downward Step 2: Invoke — the model calls a tool
CTool InvocationLLM decides → host approves → server executes
psychology
LLM Callstool_call with
name + arguments
consent
shield
Host ApprovesCheck annotations
ask user if needed
tools/call
4
play_arrow
Server ExecutesRuns the function
returns result
5
arrow_downward Tool annotations: metadata that helps the host decide
DTool AnnotationsMetadata that tells the host how dangerous a tool is
menu_book
readOnlyHintDoesn't modify
anything (safe)
vs
warning
destructiveHintDeletes or modifies
data (dangerous)
+
replay
idempotentHintSafe to retry
same result
6
arrow_downward Progress reporting: long-running tools
EProgress ReportingLong-running tools can report progress as they work
hourglass_top
Tool RunningLong operation
in progress
notify
trending_up
Progress25/100, 50/100...
via notifications
done
7
check_circle
Final ResultResponse with
content array
8
arrow_downward Dynamic tools: servers can add/remove tools at runtime
FDynamic Tool ListsServers can add or remove tools while running
add_circle
Tool AddedServer registers
new tool at runtime
notify
notifications
list_changedServer sends
change notification
refresh
refresh
Re-discoverClient calls
tools/list again
1
Detail