Describe the bug
When a server returns an InputRequiredResult containing a form-mode ElicitRequest with an unset ElicitParams.Mode, the Go SDK serializes the field as "mode": "".
The draft schema permits form-mode elicitation to either omit mode or set it to "form". An empty string matches neither the form nor the URL branch of ElicitRequestParams, so the nested ElicitRequest does not validate against the schema.
Omitting mode when it is unset would preserve the specification's backward-compatible form-mode default.
Environment tested:
v1.7.0-pre.2 (b426fbf)
- Server used:
conformance/everything-server
- Transport: stdio (
2026-07-28 draft)
To Reproduce
- Start the Go SDK conformance server over stdio using the 2026-07-28 draft protocol revision.
- Send a
prompts/get request for the test_input_required_result_prompt prompt:
{
"jsonrpc": "2.0",
"id": 1001,
"method": "prompts/get",
"params": {
"name": "test_input_required_result_prompt",
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": {"name": "test-client", "version": "1.0.0"},
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}
- Observe that the response contains
"mode": "" in the nested ElicitRequest params:
{
"jsonrpc": "2.0",
"id": 1001,
"result": {
"messages": null,
"resultType": "input_required",
"inputRequests": {
"user_context": {
"method": "elicitation/create",
"params": {
"mode": "",
"message": "Please provide context for the prompt",
"requestedSchema": {
"type": "object",
"properties": {"context": {"type": "string"}},
"required": ["context"]
}
}
}
}
}
}
Expected behavior
The mode field should be omitted when Mode is unset. Per the specification, clients treat an omitted mode as form mode. Explicitly serializing "mode": "form" would also be schema-valid.
Expected params:
{
"message": "Please provide context for the prompt",
"requestedSchema": {
"type": "object",
"properties": {
"context": {
"type": "string"
}
},
"required": ["context"]
}
}
ElicitRequestParams is defined as either ElicitRequestFormParams or ElicitRequestURLParams.
- In the form branch,
mode is optional, but when present its value must be "form".
- In the URL branch,
mode is required and its value must be "url".
Therefore, "mode": "" matches neither branch, while omitting mode matches the form branch.
Additional context
ElicitParams.Mode in mcp/protocol.go is declared as:
Mode string `json:"mode"`
Describe the bug
When a server returns an
InputRequiredResultcontaining a form-modeElicitRequestwith an unsetElicitParams.Mode, the Go SDK serializes the field as"mode": "".The draft schema permits form-mode elicitation to either omit
modeor set it to"form". An empty string matches neither the form nor the URL branch ofElicitRequestParams, so the nestedElicitRequestdoes not validate against the schema.Omitting mode when it is unset would preserve the specification's backward-compatible form-mode default.
Environment tested:
v1.7.0-pre.2(b426fbf)conformance/everything-server2026-07-28draft)To Reproduce
prompts/getrequest for thetest_input_required_result_promptprompt:{ "jsonrpc": "2.0", "id": 1001, "method": "prompts/get", "params": { "name": "test_input_required_result_prompt", "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28", "io.modelcontextprotocol/clientInfo": {"name": "test-client", "version": "1.0.0"}, "io.modelcontextprotocol/clientCapabilities": {} } } }"mode": ""in the nestedElicitRequestparams:{ "jsonrpc": "2.0", "id": 1001, "result": { "messages": null, "resultType": "input_required", "inputRequests": { "user_context": { "method": "elicitation/create", "params": { "mode": "", "message": "Please provide context for the prompt", "requestedSchema": { "type": "object", "properties": {"context": {"type": "string"}}, "required": ["context"] } } } } } }Expected behavior
The
modefield should be omitted whenModeis unset. Per the specification, clients treat an omittedmodeas form mode. Explicitly serializing"mode": "form"would also be schema-valid.Expected
params:{ "message": "Please provide context for the prompt", "requestedSchema": { "type": "object", "properties": { "context": { "type": "string" } }, "required": ["context"] } }ElicitRequestParamsis defined as eitherElicitRequestFormParamsorElicitRequestURLParams.modeis optional, but when present its value must be"form".modeis required and its value must be"url".Therefore,
"mode": ""matches neither branch, while omittingmodematches the form branch.Additional context
ElicitParams.Modeinmcp/protocol.gois declared as:ElicitParams.Mode.moderequired and was closed after maintainers clarified that omission is intentional for backward compatibility.