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\Client\Message\Request;
15:
16: use Nexus\Mcp\Enum\LoggingLevel;
17: use Nexus\Mcp\Message\Request;
18:
19: /**
20: * A request from the client to the server, to enable or adjust logging.
21: */
22: final readonly class SetLevelRequest extends Request implements ClientRequest
23: {
24: /**
25: * @param non-empty-string $jsonrpc JSON-RPC version. Must be 2.0.
26: * @param LoggingLevel $level The level of logging that the client wants to receive from the server.
27: * The server should send all logs at this level and higher (i.e., more
28: * severe) to the client as `notifications/message`.
29: */
30: public function __construct(
31: string $jsonrpc,
32: public LoggingLevel $level,
33: ) {
34: parent::__construct($jsonrpc, 'requests/setLevel', [
35: 'level' => $level->value,
36: ]);
37: }
38: }
39: