The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 14
1414| **Resources** | Passive data sources that provide read-only access to information for context, such as file contents, database schemas, or API documentation. | Retrieve documents Access knowledge bases Read calendars | Application |
1515| **Prompts** | Pre-built instruction templates that tell the model to work with specific tools and resources. | Plan a vacation Summarize my meetings Draft an email | User |
1616
17We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together.
17We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together. Examples with a `jsonrpc` field are complete messages, and the rest are excerpts.
18
19Every request carries the [protocol version and client capabilities](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture.md#statelessness-and-discovery) in `_meta`, and every result has a [`resultType`](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#responses).
1820
1921### Tools
2022
from line 33
3133| `tools/list` | Discover available tools | Array of tool definitions with schemas |
3234| `tools/call` | Execute a specific tool | Tool execution result |
3335
34**Example tool definition:**
35
36```typescript theme={null}
37{
38 name: "searchFlights",
39 description: "Search for available flights",
40 inputSchema: {
41 type: "object",
42 properties: {
43 origin: { type: "string", description: "Departure city" },
44 destination: { type: "string", description: "Arrival city" },
45 date: { type: "string", format: "date", description: "Travel date" }
46 },
47 required: ["origin", "destination", "date"]
36**Example tool definition, as returned by `tools/list`:**
37
38```json theme={null}
39{
40 "name": "searchFlights",
41 "title": "Search Flights",
42 "description": "Search for available flights",
43 "inputSchema": {
44 "type": "object",
45 "properties": {
46 "origin": { "type": "string", "description": "Departure city" },
47 "destination": { "type": "string", "description": "Arrival city" },
48 "date": {
49 "type": "string",
50 "format": "date",
51 "description": "Travel date"
52 }
53 },
54 "required": ["origin", "destination", "date"]
55 },
56 "outputSchema": {
57 "type": "object",
58 "properties": {
59 "flights": {
60 "type": "array",
61 "items": {
62 "type": "object",
63 "properties": {
64 "flightNumber": { "type": "string" },
65 "priceUsd": { "type": "number" }
66 },
67 "required": ["flightNumber", "priceUsd"]
68 }
69 }
70 },
71 "required": ["flights"]
4872 }
4973}
5074```
from line 79
5579
5680**Flight Search**
5781
58```
59searchFlights(origin: "NYC", destination: "Barcelona", date: "2024-06-15")
60```
61
62Queries multiple airlines and returns structured flight options.
82Queries multiple airlines and returns structured flight options. The arguments in the `tools/call` request conform to the tool's `inputSchema`:
83
84```json theme={null}
85{
86 "jsonrpc": "2.0",
87 "id": 1,
88 "method": "tools/call",
89 "params": {
90 "name": "searchFlights",
91 "arguments": {
92 "origin": "New York",
93 "destination": "Barcelona",
94 "date": "2027-06-15"
95 },
96 "_meta": {
97 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
98 "io.modelcontextprotocol/clientInfo": {
99 "name": "example-client",
100 "version": "1.0.0"
101 },
102 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
103 }
104 }
105}
106```
107
108The result's `structuredContent` conforms to the tool's `outputSchema`. For backwards compatibility, the result also includes the serialized JSON as text:
109
110```json theme={null}
111{
112 "jsonrpc": "2.0",
113 "id": 1,
114 "result": {
115 "resultType": "complete",
116 "content": [
117 {
118 "type": "text",
119 "text": "{\"flights\":[{\"flightNumber\":\"EX101\",\"priceUsd\":640}]}"
120 }
121 ],
122 "structuredContent": {
123 "flights": [{ "flightNumber": "EX101", "priceUsd": 640 }]
124 },
125 "_meta": {
126 "io.modelcontextprotocol/serverInfo": {
127 "name": "travel-server",
128 "version": "1.0.0"
129 }
130 }
131 }
132}
133```
134
135The other tools are called the same way, with their own `name` and `arguments`.
63136
64137**Calendar Blocking**
65138
66```
67createCalendarEvent(title: "Barcelona Trip", startDate: "2024-06-15", endDate: "2024-06-22")
68```
69
70139Marks the travel dates in the user's calendar.
71140
141```json theme={null}
142{
143 "name": "createCalendarEvent",
144 "arguments": {
145 "title": "Barcelona Trip",
146 "startDate": "2027-06-15",
147 "endDate": "2027-06-22"
148 }
149}
150```
151
72152**Email notification**
73153
74```
76```
77
78154Sends an automated out-of-office message to colleagues.
155
156```json theme={null}
157{
158 "name": "sendEmail",
159 "arguments": {
161 "subject": "Out of Office",
162 "body": "I am out of the office from June 15 to June 22."
163 }
164}
165```
79166
80167#### User Interaction Model
81168
from line 183
96183
97184Resources expose data from files, APIs, databases, or any other source that an AI needs to understand context. Applications can access this information directly and decide how to use it - whether that's selecting relevant portions, searching with embeddings, or passing it all to the model.
98185
99Each resource has a unique URI (e.g., `file:///path/to/document.md`) and declares its MIME type for appropriate content handling.
186Each resource has a unique URI (e.g., `file:///path/to/document.md`) and can declare its MIME type for appropriate content handling.
100187
101188Resources support two discovery patterns:
102189
103* **Direct Resources** - fixed URIs that point to specific data. Example: `calendar://events/2024` - returns calendar availability for 2024
104* **Resource Templates** - dynamic URIs with parameters for flexible queries. Example:
105 * `travel://activities/{city}/{category}` - returns activities by city and category
106 * `travel://activities/barcelona/museums` - returns all museums in Barcelona
107
108Resource Templates include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting.
190* **Direct Resources** - fixed URIs that point to specific data. Example: `calendar://events/2027-06` - returns calendar availability for June 2027
191* **Resource Templates** - parameterized URIs for flexible queries. Example: `travel://activities/{city}/{category}` - returns activities by city and category. For example, `travel://activities/Barcelona/museums` returns all museums in Barcelona
192
193Resource Templates can include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting.
109194
110195**Protocol operations:**
111196
from line 199
114199| `resources/list` | List available direct resources | Array of resource descriptors |
115200| `resources/templates/list` | Discover resource templates | Array of resource template definitions |
116201| `resources/read` | Retrieve resource contents | Resource data with metadata |
202| `completion/complete` | Suggest parameter values | Array of suggested values |
117203| `subscriptions/listen` | Monitor resource changes | Stream of update notifications |
118204
119To watch specific resources for changes, a client sends a [`subscriptions/listen`](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/subscriptions) request with the resource URIs listed in the `resourceSubscriptions` filter. The server delivers `notifications/resources/updated` on the resulting stream whenever a watched resource changes.
205To watch specific resources for changes, a client sends a [`subscriptions/listen`](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/subscriptions) request with the resource URIs listed in the `resourceSubscriptions` filter. Servers that support update notifications for individual resources declare `"subscribe": true` in their `resources` capability. The server delivers `notifications/resources/updated` on the resulting stream whenever a watched resource changes.
120206
121207#### Example: Getting Travel Planning Context
122208
123209Continuing with the travel planning example, resources provide the AI application with access to relevant information:
124210
125* **Calendar data** (`calendar://events/2024`) - Checks user availability
211* **Calendar data** (`calendar://events/2027-06`) - Checks user availability
126212* **Travel documents** (`file:///Documents/Travel/passport.pdf`) - Accesses important documents
127* **Previous itineraries** (`trips://history/barcelona-2023`) - References past trips and preferences
213* **Travel preferences** (`travel://preferences/europe`) - Looks up preferred airlines and hotel types
214* **Previous itineraries** (`travel://past-trips/spain-2023`) - References past trips
215* **Weather forecast** (`weather://forecast/Barcelona/2027-06-15`) - Looks up the weather for a travel date
128216
129217The AI application retrieves these resources and decides how to process them, whether selecting a subset of data using embeddings or keyword search, or passing raw data directly to the model.
130218
131In this case, it provides calendar data, weather information, and travel preferences to the model, enabling it to check availability, look up weather patterns, and reference past travel preferences.
132
133**Resource Template Examples:**
219In this case, it provides calendar data, weather information, travel preferences, and past trips to the model, enabling it to check availability, look up weather patterns, and follow the user's preferences.
220
221The AI application reads each resource with a `resources/read` request:
222
223```json theme={null}
224{
225 "jsonrpc": "2.0",
226 "id": 2,
227 "method": "resources/read",
228 "params": {
229 "uri": "calendar://events/2027-06",
230 "_meta": {
231 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
232 "io.modelcontextprotocol/clientInfo": {
233 "name": "example-client",
234 "version": "1.0.0"
235 },
236 "io.modelcontextprotocol/clientCapabilities": {
237 "elicitation": {}
238 }
239 }
240 }
241}
242```
243
244The result contains the resource contents and two [caching hints](https://modelcontextprotocol.io/specification/2026-07-28/server/utilities/caching.md). `ttlMs` is how long the client may consider the result fresh, in milliseconds, and a `cacheScope` of `"private"` means that caches must not share it across authorization contexts:
245
246```json theme={null}
247{
248 "jsonrpc": "2.0",
249 "id": 2,
250 "result": {
251 "resultType": "complete",
252 "contents": [
253 {
254 "uri": "calendar://events/2027-06",
255 "mimeType": "application/json",
256 "text": "{\"busy\":[{\"startDate\":\"2027-06-03\",\"endDate\":\"2027-06-04\"}]}"
257 }
258 ],
259 "ttlMs": 60000,
260 "cacheScope": "private",
261 "_meta": {
262 "io.modelcontextprotocol/serverInfo": {
263 "name": "calendar-email-server",
264 "version": "1.0.0"
265 }
266 }
267 }
268}
269```
270
271**Resource template examples:**
272
273From a weather server:
134274
135275```json theme={null}
136276{
from line 280
140280 "description": "Get weather forecast for any city and date",
141281 "mimeType": "application/json"
142282}
143
283```
284
285From a travel server:
286
287```json theme={null}
144288{
145289 "uriTemplate": "travel://flights/{origin}/{destination}",
146290 "name": "flight-search",
147291 "title": "Flight Search",
148 "description": "Search available flights between cities",
292 "description": "Search available flights between two airports",
149293 "mimeType": "application/json"
150294}
151295```
152296
153These templates enable flexible queries. For weather data, users can access forecasts for any city/date combination. For flights, they can search routes between any two airports. When a user has input "NYC" as the `origin` airport and begins to input "Bar" as the `destination` airport, the system can suggest "Barcelona (BCN)" or "Barbados (BGI)".
297These templates enable flexible queries. For weather data, users can access forecasts for any city/date combination. For flights, they can search routes between any two airports.
154298
155299#### Parameter Completion
156300
157Dynamic resources support parameter completion. For example:
158
159* Typing "Par" as input for `weather://forecast/{city}` might suggest "Paris" or "Park City"
160* Typing "JFK" for `flights://search/{airport}` might suggest "JFK - John F. Kennedy International"
301Servers that declare the `completions` capability can suggest values for template parameters. For example:
302
303* Typing "Par" for `city` in `weather://forecast/{city}/{date}` might suggest "Paris" or "Park City"
304* Typing "JF" for `origin` in `travel://flights/{origin}/{destination}` might suggest "JFK"
305
306When a template has multiple parameters, clients should include the values that are already resolved in `context.arguments`, so the server can narrow its suggestions. Here, the user has chosen `JFK` as the `origin` and typed "Bar" for the `destination`:
307
308```json theme={null}
309{
310 "jsonrpc": "2.0",
311 "id": 3,
312 "method": "completion/complete",
313 "params": {
314 "ref": {
315 "type": "ref/resource",
316 "uri": "travel://flights/{origin}/{destination}"
317 },
318 "argument": {
319 "name": "destination",
320 "value": "Bar"
321 },
322 "context": {
323 "arguments": {
324 "origin": "JFK"
325 }
326 },
327 "_meta": {
328 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
329 "io.modelcontextprotocol/clientInfo": {
330 "name": "example-client",
331 "version": "1.0.0"
332 },
333 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
334 }
335 }
336}
337```
338
339The server suggests the airport codes for Barcelona and Barbados, which both have flights from JFK:
340
341```json theme={null}
342{
343 "jsonrpc": "2.0",
344 "id": 3,
345 "result": {
346 "resultType": "complete",
347 "completion": {
348 "values": ["BCN", "BGI"],
349 "total": 2,
350 "hasMore": false
351 },
352 "_meta": {
353 "io.modelcontextprotocol/serverInfo": {
354 "name": "travel-server",
355 "version": "1.0.0"
356 }
357 }
358 }
359}
360```
161361
162362The system helps discover valid values without requiring exact format knowledge.
163363
from line 384
184384
185385| Method | Purpose | Returns |
186386| - | - | - |
187| `prompts/list` | Discover available prompts | Array of prompt descriptors |
188| `prompts/get` | Retrieve prompt details | Full prompt definition with arguments |
387| `prompts/list` | Discover available prompts | Array of prompt definitions, including the arguments each one accepts |
388| `prompts/get` | Retrieve a prompt | Array of prompt messages |
389| `completion/complete` | Suggest argument values | Array of suggested values |
189390
190391#### Example: Streamlined Workflows
191392
192393Prompts provide structured templates for common tasks. In the travel planning context:
193394
194**"Plan a vacation" prompt:**
395**"Plan a vacation" prompt, as returned by `prompts/list`:**
195396
196397```json theme={null}
197398{
from line 400
199400 "title": "Plan a vacation",
200401 "description": "Guide through vacation planning process",
201402 "arguments": [
202 { "name": "destination", "type": "string", "required": true },
203 { "name": "duration", "type": "number", "description": "days" },
204 { "name": "budget", "type": "number", "required": false },
205 { "name": "interests", "type": "array", "items": { "type": "string" } }
403 {
404 "name": "origin",
405 "description": "City to depart from",
406 "required": true
407 },
408 {
409 "name": "destination",
410 "description": "City to visit",
411 "required": true
412 },
413 {
414 "name": "departureDate",
415 "description": "First day of the trip, as YYYY-MM-DD",
416 "required": true
417 },
418 {
419 "name": "returnDate",
420 "description": "Last day of the trip, as YYYY-MM-DD",
421 "required": true
422 },
423 {
424 "name": "budget",
425 "description": "Total budget in USD",
426 "required": false
427 },
428 {
429 "name": "travelers",
430 "description": "Number of travelers",
431 "required": false
432 },
433 {
434 "name": "interests",
435 "description": "Comma-separated list of interests"
436 }
206437 ]
207438}
208439```
209440
441Prompt arguments don't have types. Every value is sent as a string, so use `description` to specify the expected format. Arguments are optional unless `required` is `true`.
442
210443Rather than unstructured natural language input, the prompt system enables:
211444
2124451. Selection of the "Plan a vacation" template
2132. Structured input: Barcelona, 7 days, \$3000, \["beaches", "architecture", "food"]
4462. Structured input: New York to Barcelona, June 15-22, \$3000, 2 travelers, interested in beaches, architecture, and food
2144473. Consistent workflow execution based on the template
215448
216449#### User Interaction Model
from line 478
245478
2464791. **User invokes a prompt with parameters:**
247480
481 The user picks "Plan a vacation" and fills in its arguments. The client sends a `prompts/get` request to the Travel Server:
482
248483 ```json theme={null}
249484 {
250 "prompt": "plan-vacation",
251 "arguments": {
252 "destination": "Barcelona",
253 "departure_date": "2024-06-15",
254 "return_date": "2024-06-22",
255 "budget": 3000,
256 "travelers": 2
485 "jsonrpc": "2.0",
486 "id": 4,
487 "method": "prompts/get",
488 "params": {
489 "name": "plan-vacation",
490 "arguments": {
491 "origin": "New York",
492 "destination": "Barcelona",
493 "departureDate": "2027-06-15",
494 "returnDate": "2027-06-22",
495 "budget": "3000",
496 "travelers": "2",
497 "interests": "beaches, architecture, food"
498 },
499 "_meta": {
500 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
501 "io.modelcontextprotocol/clientInfo": {
502 "name": "example-client",
503 "version": "1.0.0"
504 },
505 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
506 }
257507 }
258508 }
259509 ```
260510
511 The server returns messages that the AI application adds to the conversation:
512
513 ```json theme={null}
514 {
515 "jsonrpc": "2.0",
516 "id": 4,
517 "result": {
518 "resultType": "complete",
519 "description": "Guide through vacation planning process",
520 "messages": [
521 {
522 "role": "user",
523 "content": {
524 "type": "text",
525 "text": "Plan a vacation from New York to Barcelona for 2 travelers, from 2027-06-15 to 2027-06-22, with a total budget of $3000. Interests: beaches, architecture, food.\n\nUse the calendar, travel preferences, and past trips provided as context. Search for flights and hotels within the budget, and check the weather for the travel dates. Propose one package. After the user agrees, book it, add the trip to the calendar, and email a confirmation."
526 }
527 }
528 ],
529 "_meta": {
530 "io.modelcontextprotocol/serverInfo": {
531 "name": "travel-server",
532 "version": "1.0.0"
533 }
534 }
535 }
536 }
537 ```
538
2615392. **User selects resources to include:**
262 * `calendar://my-calendar/June-2024` (from Calendar Server)
540 * `calendar://events/2027-06` (from Calendar/Email Server)
263541 * `travel://preferences/europe` (from Travel Server)
264 * `travel://past-trips/Spain-2023` (from Travel Server)
542 * `travel://past-trips/spain-2023` (from Travel Server)
265543
2665443. **AI processes the request using tools:**
267545
268 The AI first reads all selected resources to gather context - identifying available dates from the calendar, learning preferred airlines and hotel types from travel preferences, and discovering previously enjoyed locations from past trips.
269
270 Using this context, the AI then executes the prompt provided by the AI application. In our example, the AI application exposes the weather tools from the connected MCP weather server to the model. Because weather can affect travel plans, the AI chooses to call `checkWeather()` when interpreting the prompt.
271
272 As a result the AI executes a series of tools:
273
274 * `searchFlights()` - Queries airlines for NYC to Barcelona flights
275 * `checkWeather()` - Retrieves climate forecasts for travel dates
276
277 The AI then uses this information to create the booking and following steps, requesting approval from the user where necessary:
278
279 * `bookHotel()` - Finds hotels within the specified budget
280 * `createCalendarEvent()` - Adds the trip to the user's calendar
281 * `sendEmail()` - Sends confirmation with trip details
282
283**The result:** Through multiple MCP servers, the user researched and booked a Barcelona trip tailored to their schedule. The "Plan a Vacation" prompt guided the AI to combine Resources (calendar availability and travel history) with Tools (searching flights, booking hotels, updating calendars) across different servers—gathering context and executing the booking. A task that could have taken hours was completed in minutes using MCP.
546 The AI application first reads all selected resources to gather context for the model - identifying available dates from the calendar, learning preferred airlines and hotel types from travel preferences, and discovering previously enjoyed locations from past trips.
547
548 Using this context, the model then follows the prompt provided by the Travel Server. The AI application exposes the tools from all three servers to the model, so a prompt from the Travel Server can lead the model to call `checkWeather` on the Weather Server.
549
550 As a result, the model calls a series of tools:
551
552 * `searchFlights` (from Travel Server) - Queries airlines for New York to Barcelona flights
553 * `searchHotels` (from Travel Server) - Finds hotels within the specified budget
554 * `checkWeather` (from Weather Server) - Retrieves climate forecasts for travel dates
555
556 The model then uses this information to create the booking and following steps, with the AI application requesting approval from the user where necessary:
557
558 * `bookVacation` (from Travel Server) - Books the flights and hotel. The server asks the user to confirm the booking through [elicitation](https://modelcontextprotocol.io/docs/2026-07-28/learn/client-concepts.md#elicitation)
559 * `createCalendarEvent` (from Calendar/Email Server) - Adds the trip to the user's calendar
560 * `sendEmail` (from Calendar/Email Server) - Sends confirmation with trip details
561
562**The result:** Through multiple MCP servers, the user researched and booked a Barcelona trip tailored to their schedule. The "Plan a vacation" prompt guided the AI to combine Resources (calendar availability and travel history) with Tools (searching flights and hotels, booking them, updating the calendar) across different servers—gathering context and executing the booking. A task that could have taken hours was completed in minutes using MCP.
284563