PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / wordpress / php-mcp-schema / src / Server / Tools / DTO / ToolExecution.php
ameliabooking / vendor / wordpress / php-mcp-schema / src / Server / Tools / DTO Last commit date
CallToolRequest.php 1 month ago CallToolRequestParams.php 1 month ago CallToolResult.php 1 month ago ListToolsRequest.php 1 month ago ListToolsResult.php 1 month ago Tool.php 1 month ago ToolAnnotations.php 1 month ago ToolExecution.php 1 month ago ToolInputSchema.php 1 month ago ToolListChangedNotification.php 1 month ago ToolOutputSchema.php 1 month ago
ToolExecution.php
94 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace WP\McpSchema\Server\Tools\DTO;
6
7 use WP\McpSchema\Common\AbstractDataTransferObject;
8 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
9
10 /**
11 * Execution-related properties for a tool.
12 *
13 * @since 2025-11-25
14 *
15 * @mcp-domain Server
16 * @mcp-subdomain Tools
17 * @mcp-version 2025-11-25
18 */
19 class ToolExecution extends AbstractDataTransferObject
20 {
21 use ValidatesRequiredFields;
22
23 /**
24 * Indicates whether this tool supports task-augmented execution.
25 * This allows clients to handle long-running operations through polling
26 * the task system.
27 *
28 * - "forbidden": Tool does not support task-augmented execution (default when absent)
29 * - "optional": Tool may support task-augmented execution
30 * - "required": Tool requires task-augmented execution
31 *
32 * Default: "forbidden"
33 *
34 * @since 2025-11-25
35 *
36 * @var 'forbidden'|'optional'|'required'|null
37 */
38 protected ?string $taskSupport;
39
40 /**
41 * @param 'forbidden'|'optional'|'required'|null $taskSupport @since 2025-11-25
42 */
43 public function __construct(
44 ?string $taskSupport = null
45 ) {
46 $this->taskSupport = $taskSupport;
47 }
48
49 /**
50 * Creates an instance from an array.
51 *
52 * @param array{
53 * taskSupport?: 'forbidden'|'optional'|'required'|null
54 * } $data
55 * @phpstan-param array<string, mixed> $data
56 * @return self
57 */
58 public static function fromArray(array $data): self
59 {
60 /** @var 'forbidden'|'optional'|'required'|null $taskSupport */
61 $taskSupport = isset($data['taskSupport'])
62 ? self::asStringOrNull($data['taskSupport'])
63 : null;
64
65 return new self(
66 $taskSupport
67 );
68 }
69
70 /**
71 * Converts the instance to an array.
72 *
73 * @return array<string, mixed>
74 */
75 public function toArray(): array
76 {
77 $result = [];
78
79 if ($this->taskSupport !== null) {
80 $result['taskSupport'] = $this->taskSupport;
81 }
82
83 return $result;
84 }
85
86 /**
87 * @return 'forbidden'|'optional'|'required'|null
88 */
89 public function getTaskSupport(): ?string
90 {
91 return $this->taskSupport;
92 }
93 }
94