Skip to content

Commit 819c89c

Browse files
authored
Merge pull request modelcontextprotocol#1634 from modelcontextprotocol/docs/add-pagination-resource-templates
docs: add pagination support to resource templates listing
2 parents 435a718 + 2f0eadd commit 819c89c

4 files changed

Lines changed: 29 additions & 8 deletions

File tree

docs/specification/2024-11-05/server/resources.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,19 @@ To retrieve resource contents, clients send a `resources/read` request:
163163
Resource templates allow servers to expose parameterized resources using
164164
[URI templates](https://datatracker.ietf.org/doc/html/rfc6570). Arguments may be
165165
auto-completed through [the completion API](/specification/2024-11-05/server/utilities/completion).
166+
This operation supports
167+
[pagination](/specification/2024-11-05/server/utilities/pagination).
166168

167169
**Request:**
168170

169171
```json
170172
{
171173
"jsonrpc": "2.0",
172174
"id": 3,
173-
"method": "resources/templates/list"
175+
"method": "resources/templates/list",
176+
"params": {
177+
"cursor": "optional-cursor-value"
178+
}
174179
}
175180
```
176181

@@ -188,7 +193,8 @@ auto-completed through [the completion API](/specification/2024-11-05/server/uti
188193
"description": "Access files in the project directory",
189194
"mimeType": "application/octet-stream"
190195
}
191-
]
196+
],
197+
"nextCursor": "next-page-cursor"
192198
}
193199
}
194200
```

docs/specification/2025-03-26/server/resources.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,18 @@ To retrieve resource contents, clients send a `resources/read` request:
160160
Resource templates allow servers to expose parameterized resources using
161161
[URI templates](https://datatracker.ietf.org/doc/html/rfc6570). Arguments may be
162162
auto-completed through [the completion API](/specification/2025-03-26/server/utilities/completion).
163+
This operation supports [pagination](/specification/2025-03-26/server/utilities/pagination).
163164

164165
**Request:**
165166

166167
```json
167168
{
168169
"jsonrpc": "2.0",
169170
"id": 3,
170-
"method": "resources/templates/list"
171+
"method": "resources/templates/list",
172+
"params": {
173+
"cursor": "optional-cursor-value"
174+
}
171175
}
172176
```
173177

@@ -185,7 +189,8 @@ auto-completed through [the completion API](/specification/2025-03-26/server/uti
185189
"description": "Access files in the project directory",
186190
"mimeType": "application/octet-stream"
187191
}
188-
]
192+
],
193+
"nextCursor": "next-page-cursor"
189194
}
190195
}
191196
```

docs/specification/2025-06-18/server/resources.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,18 @@ To retrieve resource contents, clients send a `resources/read` request:
163163
Resource templates allow servers to expose parameterized resources using
164164
[URI templates](https://datatracker.ietf.org/doc/html/rfc6570). Arguments may be
165165
auto-completed through [the completion API](/specification/2025-06-18/server/utilities/completion).
166+
This operation supports [pagination](/specification/2025-06-18/server/utilities/pagination).
166167

167168
**Request:**
168169

169170
```json
170171
{
171172
"jsonrpc": "2.0",
172173
"id": 3,
173-
"method": "resources/templates/list"
174+
"method": "resources/templates/list",
175+
"params": {
176+
"cursor": "optional-cursor-value"
177+
}
174178
}
175179
```
176180

@@ -189,7 +193,8 @@ auto-completed through [the completion API](/specification/2025-06-18/server/uti
189193
"description": "Access files in the project directory",
190194
"mimeType": "application/octet-stream"
191195
}
192-
]
196+
],
197+
"nextCursor": "next-page-cursor"
193198
}
194199
}
195200
```

docs/specification/draft/server/resources.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,18 @@ Alternatively, if the scheme of `uri` is `https://`, clients may fetch the resou
172172
Resource templates allow servers to expose parameterized resources using
173173
[URI templates](https://datatracker.ietf.org/doc/html/rfc6570). Arguments may be
174174
auto-completed through [the completion API](/specification/draft/server/utilities/completion).
175+
This operation supports [pagination](/specification/draft/server/utilities/pagination).
175176

176177
**Request:**
177178

178179
```json
179180
{
180181
"jsonrpc": "2.0",
181182
"id": 3,
182-
"method": "resources/templates/list"
183+
"method": "resources/templates/list",
184+
"params": {
185+
"cursor": "optional-cursor-value"
186+
}
183187
}
184188
```
185189

@@ -205,7 +209,8 @@ auto-completed through [the completion API](/specification/draft/server/utilitie
205209
}
206210
]
207211
}
208-
]
212+
],
213+
"nextCursor": "next-page-cursor"
209214
}
210215
}
211216
```

0 commit comments

Comments
 (0)