1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9: *
10: * For the full copyright and license information, please view
11: * the LICENSE file that was distributed with this source code.
12: */
13:
14: namespace Nexus\Mcp\Core\Schema\RequestParams;
15:
16: use Nexus\Mcp\Core\Schema\RequestMetaObject;
17: use Nexus\Mcp\Core\Schema\RequestParams;
18:
19: /**
20: * Common parameters when working with resources.
21: *
22: * @see https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-11-25/schema.ts
23: */
24: abstract readonly class ResourceRequestParams extends RequestParams
25: {
26: public function __construct(public string $uri, RequestMetaObject $meta = new RequestMetaObject())
27: {
28: parent::__construct($meta);
29: }
30:
31: #[\Override]
32: public function toArray(): array
33: {
34: return [
35: ...parent::toArray(),
36: 'uri' => $this->uri,
37: ];
38: }
39:
40: #[\Override]
41: public function jsonSerialize(): array
42: {
43: return $this->toArray();
44: }
45: }
46: