feat: structured errors with hint, ToolResult, cursor pagination

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-25 21:37:42 +02:00
co-authored by Claude Opus 5.5
parent 5434cb6767
commit f63d35c2f8
12 changed files with 631 additions and 14 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace LIT\MCP\Abilities;
use stdClass;
/**
* PHP encodes an empty array as JSON [] – for schema type "object" the client
* must see {}. WordPress' output validation accepts stdClass for objects.
*/
final class JsonMap
{
/**
* @param array<string, mixed> $map
* @return array<string, mixed>|stdClass
*/
public static function of(array $map): array|stdClass
{
return $map === [] ? new stdClass() : $map;
}
}