Add support for pagination on list requests (#55)

10 - Added the list resources handler with test class

10 - Update the ListPromptsHandler to use annotations

10 - Add the list resource handler, and it's test as well

10 - Added the registry logic

10 - Added the list tools handler logic

10 - Fix all php-cs-fixer related issues

10 - Resolved phpstan issues for ListPromptsHandlerTest

10 - Resolved phpstan issues for ListToolsHandlerTest

10 - Resolved phpstan issues for ListResourcesHandlerTest

10 - Resolved phpstan issues in registry class

10 - Resolved phpstan issues for the handler class

10 - Resolved php cs fixer issues

10 - Resolved all phpstan issues by generating the baseline again

10 - Remove the two loop operation and use foreach for optimization

10 - Removed unused code and resolved namespace

10 - Add signatures to interface and registry

10 - Add updated phpstan rule set

10 - Arranged according to property type

10 - Introduce reference page DTO, fix all failing test

10 - Resolve cs-fixer issues

10 - Resolve phpstan issues

10 - Resolve php cs fixer issues

10 - Created a reference directory for the Page DTO

10 - Remove manual loop for clean code readability

Co-authored-by: larry.sulebalogun <larry.sulebalogun@tillo.io>
This commit is contained in:
Sule-Balogun Olanrewaju 2025-09-24 20:44:32 +01:00 • committed by GitHub
commit 325b4aaf9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,9 +11,7 @@
namespace Mcp\Capability\Registry;
use Mcp\Schema\Prompt;
use Mcp\Schema\ResourceTemplate;
use Mcp\Schema\Tool;
use Mcp\Server\RequestHandler\Reference\Page;
/**
* Interface for providing access to registered MCP elements.
@ -45,31 +43,23 @@ interface ReferenceProviderInterface
/**
* Gets all registered tools.
*
* @return array<string, Tool>
*/
public function getTools(): array;
public function getTools(?int $limit = null, ?string $cursor = null): Page;
/**
* Gets all registered resources.
*
* @return array<string, \Mcp\Schema\Resource>
*/
public function getResources(): array;
public function getResources(?int $limit = null, ?string $cursor = null): Page;
/**
* Gets all registered prompts.
*
* @return array<string, Prompt>
*/
public function getPrompts(): array;
public function getPrompts(?int $limit = null, ?string $cursor = null): Page;
/**
* Gets all registered resource templates.
*
* @return array<string, ResourceTemplate>
*/
public function getResourceTemplates(): array;
public function getResourceTemplates(?int $limit = null, ?string $cursor = null): Page;
/**
* Checks if any elements (manual or discovered) are currently registered.