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

@shoemoney shoemoney commented Aug 1, 2026

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.


AI assistance disclosure

Per the modelcontextprotocol AI policy: this change was made in conjunction with my pair programmer, Claude Code.

Extent, so you know how much scrutiny to apply: the defect was surfaced by an automated sweep I run across MCP-ecosystem repos, and the patch was written with Claude Code working alongside me. I reviewed it before filing — the before/after test output, the baseline test counts, and the lint/format runs quoted above were executed on my machine, not pasted from a model. I understand what the change does and why, and replies on this PR are mine.

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