Class ToolInvocation

java.lang.Object
com.github.copilot.sdk.json.ToolInvocation

public final class ToolInvocation extends Object
Represents a tool invocation request from the AI assistant.

When the assistant invokes a tool, this object contains the context including the session ID, tool call ID, tool name, and arguments parsed from the assistant's request.

See Also:
  • Constructor Details

    • ToolInvocation

      public ToolInvocation()
  • Method Details

    • getSessionId

      public String getSessionId()
      Gets the session ID where the tool was invoked.
      Returns:
      the session ID
    • setSessionId

      public ToolInvocation setSessionId(String sessionId)
      Sets the session ID.
      Parameters:
      sessionId - the session ID
      Returns:
      this invocation for method chaining
    • getToolCallId

      public String getToolCallId()
      Gets the unique identifier for this tool call.

      This ID correlates the tool invocation with its response.

      Returns:
      the tool call ID
    • setToolCallId

      public ToolInvocation setToolCallId(String toolCallId)
      Sets the tool call ID.
      Parameters:
      toolCallId - the tool call ID
      Returns:
      this invocation for method chaining
    • getToolName

      public String getToolName()
      Gets the name of the tool being invoked.
      Returns:
      the tool name
    • setToolName

      public ToolInvocation setToolName(String toolName)
      Sets the tool name.
      Parameters:
      toolName - the tool name
      Returns:
      this invocation for method chaining
    • getArguments

      public Object getArguments()
      Gets the arguments passed to the tool.

      This is typically a Map<String, Object> matching the parameter schema defined in the tool's ToolDefinition.

      Returns:
      the arguments object
    • setArguments

      public ToolInvocation setArguments(Object arguments)
      Sets the tool arguments.
      Parameters:
      arguments - the arguments object
      Returns:
      this invocation for method chaining