| 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\Schema\Notification; |
| 15: | |
| 16: | use Nexus\Mcp\Schema\Message\JsonRpcNotification; |
| 17: | |
| 18: | /** |
| 19: | * An optional notification from the server to the client, informing it that the list of |
| 20: | * resources it can read from has changed. This may be issued by servers without any previous |
| 21: | * subscription from the client. |
| 22: | * |
| 23: | * @extends JsonRpcNotification<array{ |
| 24: | * jsonrpc: '2.0', |
| 25: | * method: 'notifications/resources/list_changed', |
| 26: | * params?: array{ |
| 27: | * _meta?: array<string, mixed>, |
| 28: | * } |
| 29: | * }> |
| 30: | */ |
| 31: | final readonly class ResourceListChangedNotification extends JsonRpcNotification implements ServerNotification |
| 32: | { |
| 33: | /** |
| 34: | * @param null|array<string, mixed> $meta Reserved by MCP to allow clients and servers to attach |
| 35: | * additional metadata to their interactions. |
| 36: | */ |
| 37: | public function __construct(?array $meta = null) |
| 38: | { |
| 39: | $params = isset($meta) ? ['_meta' => $meta] : null; |
| 40: | |
| 41: | parent::__construct(self::JSON_RPC_VERSION, 'notifications/resources/list_changed', $params); |
| 42: | } |
| 43: | } |
| 44: |