Client error instructions left over from before MRTR (elicitation and sampling)

Aperta Adatta ai principianti
#3,489 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
documentation

Direzione di ricerca

Inizia con le voci schema.ts, InvalidParamsError, CreateMessageRequestParams.tools e .toolChoice, e InputResponse, poi confronta i relativi commenti con il testo della specifica di sampling ed elicitation per la versione 2026-07-28. Rimuovi la riga relativa all’errore per la mancanza della funzionalità di elicitation e aggiorna le due istruzioni di sampling come descritto. Il lavoro è completato quando i commenti dello schema corrispondono al comportamento documentato di rifiuto locale e non lasciano intendere che venga inviato un errore al server.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What's broken?

The JSON schema disagrees with the spec prose

Where in the spec or docs?

https://modelcontextprotocol.io/specification/2026-07-28/client/sampling#error-handling (schema.ts InvalidParamsError, CreateMessageRequestParams.tools / .toolChoice, InputResponse)

What should happen?

Remove the elicitation line from InvalidParamsError, and replace the two sampling sentences with an instruction to refuse the unsupported operation locally and not retry, as "Error Handling" already says. ElicitResult "decline" and "cancel" are user actions, so they should not be used for a capability failure.

What actually happens?

In 2026-07-28 the client answers server requests through inputResponses, and that type has no error branch:

CreateMessageResult | ListRootsResult | ElicitResult;

Two schema comments still describe the client sending an error. InvalidParamsError lists:

Server requests an elicitation mode not declared in client capabilities

and CreateMessageRequestParams.tools and toolChoice say:

The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared.

client/sampling, "Error Handling", describes the actual outcome:

If an error occurs or the user declines the sampling request, the client does not need to replay the initial call with an error message, as the server is not waiting for a response with the InputRequiredResult pattern.

Both cases arise only after the server has broken a MUST NOT (on undeclared modes in client/elicitation, on tool-enabled requests in client/sampling). The question is what "return an error" means now: an error sent to the server (which the types do not allow) or a local failure.

Anything else?

These points concern MCP specification version 2026-07-28 and are also present in the draft pages.

An AI system helped find and cross-check these points.

Rifat Jumagulov
Arxo Law · [email protected]

Lingua principale
TypeScript
Stelle
9.8k
Fork
1.9k
Merge medio
2g 4h
PR unite (30g)
73

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/modelcontextprotocol

Tutte le issue di modelcontextprotocol/modelcontextprotocol

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.