Skip to content

http-standard-headers referee returns an invalid resources/templates/list result #474

Description

@JosephDoUrden

The http-standard-headers referee advertises { tools: {}, resources: {}, prompts: {} } in discoverCapabilities(), but handlePost() has no route for resources/templates/list. The request falls through to sendGenericResult in http-base.ts, which returns withRequiredDraftResultFields('resources/templates/list', {}). That result has no resourceTemplates member. The draft schema requires it (ListResourceTemplatesResult.required = ['cacheScope','resourceTemplates','resultType','ttlMs']), and 2025-11-25 already required resourceTemplates on its own.

A client that eagerly discovers templates whenever the resources capability is advertised schema-rejects that reply and drops the connection before any of the header checks this scenario is actually about get to run. Not theoretical: cloudflare/agents carries this scenario as a baselined expected failure, their comment reads "Alpha.10 advertises resources but returns an invalid empty result for resources/templates/list. MCPClientManager eagerly discovers templates and therefore fails before the scenario's remaining operations." So for that class of conforming client the scenario is currently unpassable for the wrong reason.

The #399 wire validation never catches it because the http scenarios' inline mocks bypass it, which is the pattern #418 describes.

The fix looks small: route templates/list to a handler returning resourceTemplates: [], or stop advertising resources in this scenario. The same fallthrough sits in every BaseHttpScenario subclass, so maybe the generic handler should return valid empty results for the four list methods instead. Happy to send a PR with a failing/passing test either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions