Record Class McpCallContext
java.lang.Object
java.lang.Record
dev.langchain4j.mcp.client.McpCallContext
public record McpCallContext(@Nullable InvocationContext invocationContext, McpClientMessage message)
extends Record
Context information for any invocation made towards an MCP server.
It contains the AI service invocation context when this is during
an AI service invocation (in other cases, the invocation context is null).
-
Constructor Summary
ConstructorsConstructorDescriptionMcpCallContext(@Nullable InvocationContext invocationContext, McpClientMessage message) Creates an instance of aMcpCallContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable InvocationContextReturns the value of theinvocationContextrecord component.message()Returns the value of themessagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpCallContext
Creates an instance of aMcpCallContextrecord class.- Parameters:
invocationContext- the value for theinvocationContextrecord componentmessage- the value for themessagerecord 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). -
invocationContext
Returns the value of theinvocationContextrecord component.- Returns:
- the value of the
invocationContextrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-