# Class ToolResultPart

java.lang.Object
com.codename1.ai.MessagePart
com.codename1.ai.ToolResultPart

public final class ToolResultPart extends MessagePart
The result of a tool invocation, sent back to the model so it can continue reasoning. Pairs with the originating `ToolCall` via the `toolCallId`. The carrying `ChatMessage` should use `Role.TOOL`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ToolResultPart(String toolCallId, String resultJson)`
  `resultJson` is the literal JSON string the tool produced.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getResultJson()`
  `String`
  `getToolCallId()`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ToolResultPart

    public ToolResultPart(String toolCallId, String resultJson)
    `resultJson` is the literal JSON string the tool produced. If the tool result isn't valid JSON, wrap it like `"{\"text\":\"...\"}"` -- the providers expect JSON-shaped values.

- ## Method Details

  - ### getToolCallId

    public String getToolCallId()

  - ### getResultJson

    public String getResultJson()