spring-projects/spring-ai · error · IllegalStateException
Elicitation not supported by the client:
Error message
Elicitation not supported by the client:
What it means
Thrown by DefaultMcpSyncRequestContext.elicit when the connected MCP client has not declared the elicitation capability (elicitEnabled() is false); the tool asks the client for structured input but the client cannot respond to elicitation requests.
Solutions
- Check elicitEnabled() before calling elicit()
- Connect with an MCP client that supports the elicitation capability
- Redesign the tool to use optional arguments instead of runtime elicitation
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/context/DefaultMcpSyncRequestContext.java:97 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11).
Data as JSON: /api/errors/36ee07d3ea52a2e8.
Report an issue: GitHub.
Appendix: source
Thrown at mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/context/DefaultMcpSyncRequestContext.java:97
if (!this.rootsEnabled()) {
throw new IllegalStateException("Roots not supported by the client: " + this.exchange.getClientInfo());
}
return this.exchange.listRoots();
}
// Elicitation
@Override
public boolean elicitEnabled() {
return !(this.exchange.getClientCapabilities() == null
|| this.exchange.getClientCapabilities().elicitation() == null);
}
@Override
public <T> StructuredElicitResult<T> elicit(Class<T> type) {
if (!this.elicitEnabled()) {
throw new IllegalStateException(
"Elicitation not supported by the client: " + this.exchange.getClientInfo());
}
Assert.notNull(type, "Elicitation response type must not be null");
ElicitResult elicitResult = this.elicitationInternal("Please provide the required information.", type, null);
if (elicitResult.action() != ElicitResult.Action.ACCEPT) {
return new StructuredElicitResult<>(elicitResult.action(), null, elicitResult.meta());
}
return new StructuredElicitResult<>(elicitResult.action(),
jsonHelper.convertFromMap(elicitResult.content(), type), elicitResult.meta());
}
@Override
public <T> StructuredElicitResult<T> elicit(ParameterizedTypeReference<T> type) {
View on GitHub (pinned to 98a7beda4f)