Class McpLogMessage

java.lang.Object
dev.langchain4j.mcp.client.logging.McpLogMessage

public class McpLogMessage extends Object
  • Constructor Details

  • Method Details

    • fromMap

      public static McpLogMessage fromMap(Map<String,Object> params)
      Parses a McpLogMessage from the contents of the 'params' object inside a 'notifications/message' message, presented as plain values.
    • fromJson

      @Deprecated(since="1.20.0", forRemoval=true) public static McpLogMessage fromJson(com.fasterxml.jackson.databind.JsonNode json)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use fromMap(Map), which does not expose Jackson types.
      Parses a McpLogMessage from the contents of the 'params' object inside a 'notifications/message' message.
    • level

      public McpLogLevel level()
    • logger

      public String logger()
    • dataAsJson

      public String dataAsJson()
      Returns the log payload as JSON text.
    • dataAsMap

      public Map<String,Object> dataAsMap()
      Returns the log payload as a plain map, so consumers do not need a JSON library.
      Returns:
      null when the payload is not a JSON object. MCP allows any JSON-serializable value here and a plain string is common, so use dataAsObject() to read those.
    • dataAsObject

      public Object dataAsObject()
      Returns the log payload as a plain JDK value: a String, a Map, a List, a boxed primitive, or null. MCP defines the payload as any JSON-serializable value, so this is the accessor that can represent all of them.
    • data

      @Deprecated(since="1.20.0", forRemoval=true) public com.fasterxml.jackson.databind.JsonNode data()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object