Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Schema/Result/ListResourcesResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
use Mcp\Exception\InvalidArgumentException;
use Mcp\Schema\JsonRpc\Response;
use Mcp\Schema\JsonRpc\ResultInterface;
use Mcp\Schema\Resource;
use Mcp\Schema\Resource as ResourceSchema;

/**
* The server's response to a resources/list request from the client.
*
* @phpstan-import-type ResourceData from Resource
* @phpstan-import-type ResourceData from ResourceSchema
*
* @author Kyrian Obikwelu <koshnawaza@gmail.com>
*/
class ListResourcesResult implements ResultInterface
{
/**
* @param array<resource> $resources the list of resource definitions
* @param string|null $nextCursor An opaque token representing the pagination position after the last returned result.
* @param array<ResourceSchema> $resources the list of resource definitions
* @param string|null $nextCursor An opaque token representing the pagination position after the last returned result.
*
* If present, there may be more results available.
*/
Expand All @@ -50,14 +50,14 @@ public static function fromArray(array $data): self
}

return new self(
array_map(fn (array $resource) => Resource::fromArray($resource), $data['resources']),
array_map(fn (array $resource) => ResourceSchema::fromArray($resource), $data['resources']),
$data['nextCursor'] ?? null
);
}

/**
* @return array{
* resources: array<resource>,
* resources: array<ResourceSchema>,
* nextCursor?: string,
* }
*/
Expand Down