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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user