2727use Mcp \Schema \ResourceTemplate ;
2828use Mcp \Schema \ServerCapabilities ;
2929use Mcp \Schema \Tool ;
30- use Mcp \Server \RequestHandler \ReferencePage ;
30+ use Mcp \Server \RequestHandler \Reference \ Page ;
3131use Psr \EventDispatcher \EventDispatcherInterface ;
3232use Psr \Log \LoggerInterface ;
3333use Psr \Log \NullLogger ;
@@ -248,15 +248,15 @@ public function getPrompt(string $name): ?PromptReference
248248 /**
249249 * Gets all registered tools.
250250 */
251- public function getTools (?int $ limit = null , ?string $ cursor = null ): ReferencePage
251+ public function getTools (?int $ limit = null , ?string $ cursor = null ): Page
252252 {
253253 $ tools = [];
254254 foreach ($ this ->tools as $ toolReference ) {
255255 $ tools [$ toolReference ->tool ->name ] = $ toolReference ->tool ;
256256 }
257257
258258 if (null === $ limit ) {
259- return new ReferencePage ($ tools , null );
259+ return new Page ($ tools , null );
260260 }
261261
262262 $ paginatedTools = $ this ->paginateResults ($ tools , $ limit , $ cursor );
@@ -267,21 +267,21 @@ public function getTools(?int $limit = null, ?string $cursor = null): ReferenceP
267267 $ limit
268268 );
269269
270- return new ReferencePage ($ paginatedTools , $ nextCursor );
270+ return new Page ($ paginatedTools , $ nextCursor );
271271 }
272272
273273 /**
274274 * Gets all registered resources.
275275 */
276- public function getResources (?int $ limit = null , ?string $ cursor = null ): ReferencePage
276+ public function getResources (?int $ limit = null , ?string $ cursor = null ): Page
277277 {
278278 $ resources = [];
279279 foreach ($ this ->resources as $ resourceReference ) {
280280 $ resources [$ resourceReference ->schema ->uri ] = $ resourceReference ->schema ;
281281 }
282282
283283 if (null === $ limit ) {
284- return new ReferencePage ($ resources , null );
284+ return new Page ($ resources , null );
285285 }
286286
287287 $ paginatedResources = $ this ->paginateResults ($ resources , $ limit , $ cursor );
@@ -292,21 +292,21 @@ public function getResources(?int $limit = null, ?string $cursor = null): Refere
292292 $ limit
293293 );
294294
295- return new ReferencePage ($ paginatedResources , $ nextCursor );
295+ return new Page ($ paginatedResources , $ nextCursor );
296296 }
297297
298298 /**
299299 * Gets all registered prompts.
300300 */
301- public function getPrompts (?int $ limit = null , ?string $ cursor = null ): ReferencePage
301+ public function getPrompts (?int $ limit = null , ?string $ cursor = null ): Page
302302 {
303303 $ prompts = [];
304304 foreach ($ this ->prompts as $ promptReference ) {
305305 $ prompts [$ promptReference ->prompt ->name ] = $ promptReference ->prompt ;
306306 }
307307
308308 if (null === $ limit ) {
309- return new ReferencePage ($ prompts , null );
309+ return new Page ($ prompts , null );
310310 }
311311
312312 $ paginatedPrompts = $ this ->paginateResults ($ prompts , $ limit , $ cursor );
@@ -317,21 +317,21 @@ public function getPrompts(?int $limit = null, ?string $cursor = null): Referenc
317317 $ limit
318318 );
319319
320- return new ReferencePage ($ paginatedPrompts , $ nextCursor );
320+ return new Page ($ paginatedPrompts , $ nextCursor );
321321 }
322322
323323 /**
324324 * Gets all registered resource templates.
325325 */
326- public function getResourceTemplates (?int $ limit = null , ?string $ cursor = null ): ReferencePage
326+ public function getResourceTemplates (?int $ limit = null , ?string $ cursor = null ): Page
327327 {
328328 $ templates = [];
329329 foreach ($ this ->resourceTemplates as $ templateReference ) {
330330 $ templates [$ templateReference ->resourceTemplate ->uriTemplate ] = $ templateReference ->resourceTemplate ;
331331 }
332332
333333 if (null === $ limit ) {
334- return new ReferencePage ($ templates , null );
334+ return new Page ($ templates , null );
335335 }
336336
337337 $ paginatedTemplates = $ this ->paginateResults ($ templates , $ limit , $ cursor );
@@ -342,7 +342,7 @@ public function getResourceTemplates(?int $limit = null, ?string $cursor = null)
342342 $ limit
343343 );
344344
345- return new ReferencePage ($ paginatedTemplates , $ nextCursor );
345+ return new Page ($ paginatedTemplates , $ nextCursor );
346346 }
347347
348348 public function hasElements (): bool
0 commit comments