Interface ToolCallGuardrail.CallContext

Enclosing interface:
ToolCallGuardrail

@DoNotInherit public static interface ToolCallGuardrail.CallContext
Per-call context passed to a ToolCallGuardrail during ToolCallGuardrail.decide(akka.javasdk.agent.ToolCallGuardrail.CallContext).

Carries data about the specific tool call being checked.

For construction-time data that doesn't change per call (the guardrail's configured name and its config section) accept a GuardrailContext parameter in the constructor.

  • Method Details

    • agentId

      String agentId()
      The id of the agent performing the tool call.
    • toolName

      String toolName()
      The name of the tool about to be called. For an MCP tool, the name on the MCP server.
    • toolCallId

      String toolCallId()
      The id of the tool call, correlating it with the model's tool-call request. Never null, but empty when the model provider does not assign one.
    • arguments

      String arguments()
    • sessionId

      String sessionId()
      The session id of the interaction.
    • origin

      Where the called tool runs.
    • tracing

      Tracing tracing()
      Provides access to tracing for custom application-specific tracing.

      Spans started through this are parented to the tool call being checked, so work the guardrail performs (e.g. calling external or internal components) shows up under the interaction's trace.

      Returns:
      tracing interface for custom tracing