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)
ianegordon added a commit to ianegordon/swift-sdk that referenced this pull request Sep 11, 2026
…urces/templates/list (upstream modelcontextprotocol#269, shoemoney)

Manifest entry 6. Upstream refs/pull/269/head at 4a7d8ef, unmodified.

The everything-server listed test://template/{id} under resources/list and
registered no ListResourceTemplates handler, so the template was advertised
at the wrong endpoint and reachable at neither. Confirmed on the wire before
the merge: resources/templates/list answered -32601.

Spec-correct per the 2025-11-25 schema this SDK targets — Resource.uri is
format: uri, ResourceTemplate.uriTemplate is format: uri-template (RFC 6570),
and {id} is a template, not a URI.

Note the PR's stated justification does not reproduce: resources-list passes
on runner 0.1.15 (the version ci.yml pins) and 0.1.16, on every suite, because
JSON Schema format is annotation-only by default. This fixes a latent spec
violation, not a failing test. Conformance harness only; no MCP library change,
so no downstream impact either way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eb9yGSXH1TVkg5Afsu9phk
ianegordon added a commit to ianegordon/swift-sdk that referenced this pull request Sep 11, 2026
…mple to 0.12.2-ianegordon.6

The everything-server listed test://template/{id} under resources/list and
registered no ListResourceTemplates handler, so the template was advertised
at the wrong endpoint and reachable at neither — resources/templates/list
answered -32601. Confirmed on the wire before and after the merge.

Spec-correct per the 2025-11-25 schema: Resource.uri is format: uri,
ResourceTemplate.uriTemplate is format: uri-template (RFC 6570).

The entry records that the PR's stated justification does not reproduce —
resources-list passes on runner 0.1.15 and 0.1.16 on every suite, because
JSON Schema format is annotation-only by default — so this fixes a latent
spec violation rather than a failing test. Conformance harness only; the
MCP library is untouched.

Remaining candidates renumbered 7-8 to 6-7.

Tracking: fork issue #10.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eb9yGSXH1TVkg5Afsu9phk
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