Skip to content

fix(conformance): don't return a resource template from resources/list - #269

Open
shoemoney wants to merge 1 commit into
modelcontextprotocol:mainfrom
shoemoney:fix/resources-list-template
Open

fix(conformance): don't return a resource template from resources/list#269
shoemoney wants to merge 1 commit into
modelcontextprotocol:mainfrom
shoemoney:fix/resources-list-template

Conversation

@shoemoney

Copy link
Copy Markdown

The everything-server listed test://template/{id} in its resources/list response. Two problems:

  • resources/list is specified to return direct resources; templates belong in resources/templates/list.
  • {id} is not a valid URI, so the response fails the spec's JSON-schema check on ListResourcesResult/resources/3/uri (format: "uri").

There was no ListResourceTemplates handler registered at all, so the template was never reachable at its correct endpoint either. This moves it to a resources/templates/list handler. The ReadResource handler already understood the test://template/ prefix, so template reads are unaffected.

Verified against the official conformance runner on macOS 26 / arm64, Swift 6.2.4:

before   67 passed, 2 failed   (resources-list, elicitation-sep1330-enums)
after    68 passed, 1 failed   (elicitation-sep1330-enums)

Found while adding a swift-sdk entry to the conformance matrix: modelcontextprotocol/conformance#432.

The everything-server listed "test://template/{id}" in its resources/list
response. Two problems:

  - resources/list is specified to return direct resources; templates belong in
    resources/templates/list.
  - "{id}" is not a valid URI, so the response failed the spec's JSON schema
    check on ListResourcesResult/resources/N/uri (format: "uri").

There was no ListResourceTemplates handler registered at all, so the template
was never reachable at its correct endpoint either.

Moves the template to a resources/templates/list handler. The ReadResource
handler already understood the test://template/ prefix, so template reads are
unaffected.

Verified against the official conformance runner on macOS 26 / arm64,
Swift 6.2.4:

  before   67 passed, 2 failed   (resources-list, elicitation-sep1330-enums)
  after    68 passed, 1 failed   (elicitation-sep1330-enums)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant