Package akka.javasdk.agent
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 Summary
Modifier and TypeMethodDescriptionagentId()The id of the agent performing the tool call.The raw JSON arguments of the tool call.origin()Where the called tool runs.The session id of the interaction.The id of the tool call, correlating it with the model's tool-call request.toolName()The name of the tool about to be called.tracing()Provides access to tracing for custom application-specific tracing.
-
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()The raw JSON arguments of the tool call. For an MCP tool with aRemoteMcpTools.ToolInterceptor, the arguments thatRemoteMcpTools.ToolInterceptor.interceptRequest(akka.javasdk.agent.RemoteMcpTools.ToolInterceptorContext, java.lang.String)returns. -
sessionId
String sessionId()The session id of the interaction. -
origin
ToolCallGuardrail.ToolOrigin 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
-