1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2025 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\Server\Message\Notification;
15:
16: use Nexus\Mcp\Message\Notification;
17:
18: /**
19: * A notification from the server to the client, informing it that a resource has changed
20: * and may need to be read again. This should only be sent if the client previously sent a
21: * `resources/subscribe` request.
22: */
23: final readonly class ResourceUpdatedNotification extends Notification implements ServerNotification
24: {
25: /**
26: * @param non-empty-string $jsonrpc JSON-RPC version. Must be 2.0.
27: * @param non-empty-string $uri The URI of the resource that has been updated.
28: * This might be a sub-resource of the one that the client actually subscribed to.
29: */
30: public function __construct(
31: string $jsonrpc,
32: public string $uri,
33: ) {
34: parent::__construct($jsonrpc, 'notifications/resources/updated', ['uri' => $uri]);
35: }
36: }
37: