Record Class McpDiscoverResult
java.lang.Object
java.lang.Record
dev.langchain4j.mcp.client.McpDiscoverResult
- Record Components:
supportedVersions- the protocol versions the server can speak, nevernullcapabilities- the optional protocol features the server offers, such astoolsorresources, as a tree of nested maps; nevernull, but empty for a server that offers noneserverInfo- which server this is, if it saysinstructions- a hint from the server on how it is meant to be used, if it provides oneresultType- how the server answered;"complete"for an ordinary answer
public record McpDiscoverResult(List<String> supportedVersions, Map<String,Object> capabilities, @Nullable McpServerInfo serverInfo, @Nullable String instructions, @Nullable String resultType)
extends Record
What an MCP server reports about itself when the client connects to it, using the
server/discover request of MCP protocol version 2026-07-28 and later.
It is delivered to McpClientListener.afterServerDiscover(McpCallContext, McpDiscoverResult).-
Constructor Summary
ConstructorsConstructorDescriptionMcpDiscoverResult(List<String> supportedVersions, Map<String, Object> capabilities, @Nullable McpServerInfo serverInfo, @Nullable String instructions, @Nullable String resultType) Creates an instance of aMcpDiscoverResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecapabilitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of theinstructionsrecord component.@Nullable StringReturns the value of theresultTyperecord component.@Nullable McpServerInfoReturns the value of theserverInforecord component.Returns the value of thesupportedVersionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpDiscoverResult
public McpDiscoverResult(List<String> supportedVersions, Map<String, Object> capabilities, @Nullable McpServerInfo serverInfo, @Nullable String instructions, @Nullable String resultType) Creates an instance of aMcpDiscoverResultrecord class.- Parameters:
supportedVersions- the value for thesupportedVersionsrecord componentcapabilities- the value for thecapabilitiesrecord componentserverInfo- the value for theserverInforecord componentinstructions- the value for theinstructionsrecord componentresultType- the value for theresultTyperecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
supportedVersions
Returns the value of thesupportedVersionsrecord component.- Returns:
- the value of the
supportedVersionsrecord component
-
capabilities
Returns the value of thecapabilitiesrecord component.- Returns:
- the value of the
capabilitiesrecord component
-
serverInfo
Returns the value of theserverInforecord component.- Returns:
- the value of the
serverInforecord component
-
instructions
Returns the value of theinstructionsrecord component.- Returns:
- the value of the
instructionsrecord component
-
resultType
Returns the value of theresultTyperecord component.- Returns:
- the value of the
resultTyperecord component
-