Class DefaultMcpSyncRequestContext
java.lang.Object
org.springaicommunity.mcp.context.DefaultMcpSyncRequestContext
- All Implemented Interfaces:
McpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>,McpSyncRequestContext
- Author:
- Christian Tzolov
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.springaicommunity.mcp.context.McpRequestContextTypes
McpRequestContextTypes.ElicitationSpec, McpRequestContextTypes.LoggingSpec, McpRequestContextTypes.ModelPreferenceSpec, McpRequestContextTypes.ProgressSpec, McpRequestContextTypes.SamplingSpec -
Method Summary
Modifier and TypeMethodDescriptionbuilder()io.modelcontextprotocol.spec.McpSchema.ClientCapabilitiesio.modelcontextprotocol.spec.McpSchema.Implementationvoid<T> StructuredElicitResult<T>elicit(com.fasterxml.jackson.core.type.TypeReference<T> type) io.modelcontextprotocol.spec.McpSchema.ElicitResultelicit(io.modelcontextprotocol.spec.McpSchema.ElicitRequest elicitRequest) <T> StructuredElicitResult<T><T> StructuredElicitResult<T>elicit(Consumer<McpRequestContextTypes.ElicitationSpec> params, com.fasterxml.jackson.core.type.TypeReference<T> returnType) <T> StructuredElicitResult<T>elicit(Consumer<McpRequestContextTypes.ElicitationSpec> params, Class<T> returnType) booleanvoidio.modelcontextprotocol.server.McpSyncServerExchangeexchange()voidvoidlog(Consumer<McpRequestContextTypes.LoggingSpec> logSpec) voidping()voidprogress(int percentage) voidprogress(io.modelcontextprotocol.spec.McpSchema.ProgressNotification progressNotification) voidprogress(Consumer<McpRequestContextTypes.ProgressSpec> progressSpec) io.modelcontextprotocol.spec.McpSchema.Requestrequest()io.modelcontextprotocol.spec.McpSchema.ListRootsResultroots()booleanio.modelcontextprotocol.spec.McpSchema.CreateMessageResultsample(io.modelcontextprotocol.spec.McpSchema.CreateMessageRequest createMessageRequest) io.modelcontextprotocol.spec.McpSchema.CreateMessageResultio.modelcontextprotocol.spec.McpSchema.CreateMessageResultsample(Consumer<McpRequestContextTypes.SamplingSpec> samplingSpec) booleanio.modelcontextprotocol.common.McpTransportContextvoid
-
Method Details
-
rootsEnabled
public boolean rootsEnabled()- Specified by:
rootsEnabledin interfaceMcpSyncRequestContext
-
roots
public io.modelcontextprotocol.spec.McpSchema.ListRootsResult roots()- Specified by:
rootsin interfaceMcpSyncRequestContext
-
elicitEnabled
public boolean elicitEnabled()- Specified by:
elicitEnabledin interfaceMcpSyncRequestContext
-
elicit
- Specified by:
elicitin interfaceMcpSyncRequestContext
-
elicit
- Specified by:
elicitin interfaceMcpSyncRequestContext
-
elicit
public <T> StructuredElicitResult<T> elicit(Consumer<McpRequestContextTypes.ElicitationSpec> params, Class<T> returnType) - Specified by:
elicitin interfaceMcpSyncRequestContext
-
elicit
public <T> StructuredElicitResult<T> elicit(Consumer<McpRequestContextTypes.ElicitationSpec> params, com.fasterxml.jackson.core.type.TypeReference<T> returnType) - Specified by:
elicitin interfaceMcpSyncRequestContext
-
elicit
public io.modelcontextprotocol.spec.McpSchema.ElicitResult elicit(io.modelcontextprotocol.spec.McpSchema.ElicitRequest elicitRequest) - Specified by:
elicitin interfaceMcpSyncRequestContext
-
sampleEnabled
public boolean sampleEnabled()- Specified by:
sampleEnabledin interfaceMcpSyncRequestContext
-
sample
- Specified by:
samplein interfaceMcpSyncRequestContext
-
sample
public io.modelcontextprotocol.spec.McpSchema.CreateMessageResult sample(Consumer<McpRequestContextTypes.SamplingSpec> samplingSpec) - Specified by:
samplein interfaceMcpSyncRequestContext
-
sample
public io.modelcontextprotocol.spec.McpSchema.CreateMessageResult sample(io.modelcontextprotocol.spec.McpSchema.CreateMessageRequest createMessageRequest) - Specified by:
samplein interfaceMcpSyncRequestContext
-
progress
public void progress(int percentage) - Specified by:
progressin interfaceMcpSyncRequestContext
-
progress
- Specified by:
progressin interfaceMcpSyncRequestContext
-
progress
public void progress(io.modelcontextprotocol.spec.McpSchema.ProgressNotification progressNotification) - Specified by:
progressin interfaceMcpSyncRequestContext
-
ping
public void ping()- Specified by:
pingin interfaceMcpSyncRequestContext
-
log
- Specified by:
login interfaceMcpSyncRequestContext
-
debug
- Specified by:
debugin interfaceMcpSyncRequestContext
-
info
- Specified by:
infoin interfaceMcpSyncRequestContext
-
warn
- Specified by:
warnin interfaceMcpSyncRequestContext
-
error
- Specified by:
errorin interfaceMcpSyncRequestContext
-
request
public io.modelcontextprotocol.spec.McpSchema.Request request()- Specified by:
requestin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
exchange
public io.modelcontextprotocol.server.McpSyncServerExchange exchange()- Specified by:
exchangein interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
sessionId
- Specified by:
sessionIdin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
clientInfo
public io.modelcontextprotocol.spec.McpSchema.Implementation clientInfo()- Specified by:
clientInfoin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
clientCapabilities
public io.modelcontextprotocol.spec.McpSchema.ClientCapabilities clientCapabilities()- Specified by:
clientCapabilitiesin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
requestMeta
- Specified by:
requestMetain interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
transportContext
public io.modelcontextprotocol.common.McpTransportContext transportContext()- Specified by:
transportContextin interfaceMcpRequestContextTypes<io.modelcontextprotocol.server.McpSyncServerExchange>
-
builder
-