docs: bring comments and docs in line with -32021 and the Skills registry entry (#2374 review)

Round 2 found text the PR's own changes made stale: the fixture's
option doc, handler summary and repro step still promised -32601 on
modern; the core skills.ts header still said Skills must never be in
ADVERTISABLE_EXTENSIONS; the listSkills and getSkillResult comments
still said the codec validates none of a skills result, or that the
result arrives as the server sent it; and two tests and a docs step
still described Tasks as the only registry extension. The backfill
test also now asserts the Skills declaration is on by default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3RsrgCxVoFPokLB4vAkxi
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-09-14 09:07:58 -04:00
commit 2243849711
2 changed files with 49 additions and 28 deletions

View file

@ -615,11 +615,14 @@ export interface ServerConfig {
*/
skills?: boolean;
/**
* With {@link ServerConfig.skills}, answer `skills/list`, `skills/get` and
* `resources/directory/read` with `-32601` unless the client declared
* With {@link ServerConfig.skills}, refuse `skills/list`, `skills/get` and
* `resources/directory/read` unless the client declared
* `io.modelcontextprotocol/skills` in its own capabilities — a strict
* SEP-2133 server (#2373). Off by default so the existing skills fixtures
* keep serving any client. Ignored without `skills`.
* SEP-2133 server (#2373). A modern request is refused with `-32021`
* MissingRequiredClientCapability carrying `data.requiredCapabilities`; a
* legacy one, whose era has no such code, with `-32601`. Off by default so
* the existing skills fixtures keep serving any client. Ignored without
* `skills`.
*/
skillsRequireClientExtension?: boolean;
/**

View file

@ -729,7 +729,9 @@ function hasSkillsExtension(capabilities: unknown): boolean {
}
/**
* Throw `-32601` when the client did not declare the Skills extension.
* Refuse the request when the client did not declare the Skills extension:
* `-32021` MissingRequiredClientCapability for a modern request, `-32601` for
* a legacy one.
*
* The two eras keep the declaration in different places. A modern
* (2026-07-28) request carries it in its own `_meta` envelope, which the SDK