Skip to content

Commit d75dca7

Browse files
committed
chore: minor cosmetic changes
1 parent 4ec9b60 commit d75dca7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/Capability/Formatter/ResourceResultFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class ResourceResultFormatter
4646
* - array with 'text' key: Used as text content
4747
* - SplFileInfo: Read and converted to blob
4848
* - array: Converted to JSON if MIME type is application/json or contains 'json'
49-
* For other MIME types, will also convert to JSON
49+
* For other MIME types, will try to convert to JSON with a warning
5050
*/
5151
public function format(mixed $readResult, string $uri, ?string $mimeType = null, mixed $meta = null): array
5252
{

src/Capability/Registry/ResourceReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
* - array with 'text' key: Used as text content
5252
* - SplFileInfo: Read and converted to blob
5353
* - array: Converted to JSON if MIME type is application/json or contains 'json'
54-
* For other MIME types, will also convert to JSON
54+
* For other MIME types, will try to convert to JSON with a warning
5555
*/
5656
public function formatResult(mixed $readResult, string $uri, ?string $mimeType = null): array
5757
{

src/Capability/Registry/ResourceTemplateReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function extractVariables(string $uri): array
8484
* - array with 'text' key: Used as text content
8585
* - SplFileInfo: Read and converted to blob
8686
* - array: Converted to JSON if MIME type is application/json or contains 'json'
87-
* For other MIME types, will also convert to JSON
87+
* For other MIME types, will try to convert to JSON with a warning
8888
*/
8989
public function formatResult(mixed $readResult, string $uri, ?string $mimeType = null): array
9090
{

src/Capability/Registry/ToolReference.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Mcp\Capability\Registry;
1313

1414
use Mcp\Capability\Formatter\ToolResultFormatter;
15+
use Mcp\Schema\Content\Content;
1516
use Mcp\Schema\Tool;
1617

1718
/**
@@ -47,7 +48,7 @@ public function __construct(
4748
*
4849
* @param mixed $toolExecutionResult the raw value returned by the tool's PHP method
4950
*
50-
* @return \Mcp\Schema\Content\Content[] the content items for CallToolResult
51+
* @return Content[] the content items for CallToolResult
5152
*
5253
* @throws \JsonException if JSON encoding fails for non-Content array/object results
5354
*/
@@ -71,7 +72,7 @@ public function extractStructuredContent(mixed $toolExecutionResult): ?array
7172
return $toolExecutionResult;
7273
}
7374

74-
if (\is_object($toolExecutionResult) && !($toolExecutionResult instanceof \Mcp\Schema\Content\Content)) {
75+
if (\is_object($toolExecutionResult) && !($toolExecutionResult instanceof Content)) {
7576
$jsonResult = json_encode(
7677
$toolExecutionResult,
7778
\JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE | \JSON_THROW_ON_ERROR | \JSON_INVALID_UTF8_SUBSTITUTE

0 commit comments

Comments
 (0)