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\Message\Request;
15:
16: use Nexus\Mcp\Client\Message\Request\ClientRequest;
17: use Nexus\Mcp\Message\Request;
18: use Nexus\Mcp\Server\Message\Request\ServerRequest;
19:
20: /**
21: * A ping, issued by either the server or the client, to check that the other party is still alive.
22: * The receiver must promptly respond, or else may be disconnected.
23: */
24: final readonly class PingRequest extends Request implements ClientRequest, ServerRequest
25: {
26: /**
27: * @param non-empty-string $jsonrpc JSON-RPC version. Must be 2.0.
28: * @param null|array<string, mixed> $params Additional request parameters.
29: */
30: public function __construct(string $jsonrpc, ?array $params = null)
31: {
32: parent::__construct($jsonrpc, 'ping', $params);
33: }
34: }
35: