Skip to content

Conversation

@pushpak1300
Copy link
Member

@pushpak1300 pushpak1300 commented Nov 18, 2025

The Text and Blob content classes were including name and title fields in their toResource() output, which are not part of the MCP specification for resource contents.

Changes

  • Removed name and title from Text::toResource() in src/Server/Content/Text.php
  • Removed name and title from Blob::toResource() in src/Server/Content/Blob.php
  • Updated all affected test expectations to match the corrected schema

According to the https://modelcontextprotocol.io/specification/2025-06-18/schema#textresourcecontents:

TextResourceContents should only include:

  • uri (required)
  • mimeType (optional)
  • text (required)
  • _meta (optional)

BlobResourceContents should only include:

  • uri (required)
  • mimeType (optional)
  • blob (required)
  • _meta (optional)

The name and title fields belong to the resource descriptor itself, not the content payload.

@pushpak1300 pushpak1300 marked this pull request as ready for review November 18, 2025 10:47
@taylorotwell taylorotwell merged commit 0b86fb6 into main Nov 18, 2025
18 checks passed
@taylorotwell taylorotwell deleted the fix/resource_schema branch November 18, 2025 14:41
pushpak1300 added a commit that referenced this pull request Nov 24, 2025
* Remove non-spec fields from resource content responses * Update the minimum code coverage threshold to 91.7%
taylorotwell added a commit that referenced this pull request Nov 28, 2025
* Add Resource Template * Fix code styling * Add _meta support (#106) * Add meta and security scheme to tools * Fix phpstan definition * WIP 🚧 * WIP * Update the meta $property addition * Introduce `ResponseFactory` for handling responses with result-level metadata. * Replace `UnexpectedValueException` with `InvalidArgumentException` in `ResponseFactory` and improve type validation logic. * Formatting * Fix test and change the API * Refactor * Refactor * Update method signatures * Update Test * Improve testing --------- Co-authored-by: zacksmash <zachary.warren@me.com> # Conflicts: #	tests/Unit/Methods/ReadResourceTest.php * Remove non-spec fields from resource content responses (#110) * Remove non-spec fields from resource content responses * Update the minimum code coverage threshold to 91.7% * Update CHANGELOG * Merge branch 'main' into add_support_for_resorce_templatees # Conflicts: #	tests/Unit/Methods/ReadResourceTest.php * Fix code styling * Fix test * Refactor * Refactor * Add Test * Refactor * Add Test * Refactor UriTemplate methods * Refactor * Refactor * Refactor * Refactor * Add More Test * Add make:: method * Refactor Test * Refactor * Refactor * Fix Test * Refactor tools variable name * Formatting * SupportUriTemplate -> SupportsUriTemplate * improve numeric readability * Update the test coverage threshold * Remove redundant test * formatting * add files * formatting --------- Co-authored-by: zacksmash <zachary.warren@me.com> Co-authored-by: taylorotwell <463230+taylorotwell@users.noreply.github.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants