Class BetaManagedAgentsAgentMcpToolUseEvent
-
- All Implemented Interfaces:
public final class BetaManagedAgentsAgentMcpToolUseEventEvent emitted when the agent invokes a tool provided by an MCP server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaManagedAgentsAgentMcpToolUseEvent.BuilderA builder for BetaManagedAgentsAgentMcpToolUseEvent.
public final classBetaManagedAgentsAgentMcpToolUseEvent.InputInput parameters for the tool call.
-
Method Summary
Modifier and Type Method Description final Stringid()Unique identifier for this event. final BetaManagedAgentsAgentMcpToolUseEvent.Inputinput()Input parameters for the tool call. final StringmcpServerName()Name of the MCP server providing the tool. final Stringname()Name of the MCP tool being used. final OffsetDateTimeprocessedAt()Timestamp when this event was processed. final Optional<BetaManagedAgentsAgentEvaluatedPermission>evaluatedPermission()The evaluated permission policy for this tool invocation. final Optional<BetaManagedAgentsAgentToolEvaluation>evaluation()Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). final Optional<String>sessionThreadId()When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. final JsonValue_type()Expected to always return the following:
However, this method can be useful for debugging and logging (e.g.JsonValue.from("agent.mcp_tool_use")final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<BetaManagedAgentsAgentMcpToolUseEvent.Input>_input()Returns the raw JSON value of input. final JsonField<String>_mcpServerName()Returns the raw JSON value of mcpServerName. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<OffsetDateTime>_processedAt()Returns the raw JSON value of processedAt. final JsonField<BetaManagedAgentsAgentEvaluatedPermission>_evaluatedPermission()Returns the raw JSON value of evaluatedPermission. final JsonField<BetaManagedAgentsAgentToolEvaluation>_evaluation()Returns the raw JSON value of evaluation. final JsonField<String>_sessionThreadId()Returns the raw JSON value of sessionThreadId. final Map<String, JsonValue>_additionalProperties()final BetaManagedAgentsAgentMcpToolUseEvent.BuildertoBuilder()final BetaManagedAgentsAgentMcpToolUseEventvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsAgentMcpToolUseEvent.Builderbuilder()Returns a mutable builder for constructing an instance of BetaManagedAgentsAgentMcpToolUseEvent. -
-
Method Detail
-
input
final BetaManagedAgentsAgentMcpToolUseEvent.Input input()
Input parameters for the tool call.
-
mcpServerName
final String mcpServerName()
Name of the MCP server providing the tool.
-
processedAt
final OffsetDateTime processedAt()
Timestamp when this event was processed.
-
evaluatedPermission
final Optional<BetaManagedAgentsAgentEvaluatedPermission> evaluatedPermission()
The evaluated permission policy for this tool invocation.
-
evaluation
final Optional<BetaManagedAgentsAgentToolEvaluation> evaluation()
Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).
-
sessionThreadId
final Optional<String> sessionThreadId()
When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching
user.tool_confirmationbytool_use_id, so clients do not send it back.
-
_type
final JsonValue _type()
Expected to always return the following:
JsonValue.from("agent.mcp_tool_use")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_input
final JsonField<BetaManagedAgentsAgentMcpToolUseEvent.Input> _input()
Returns the raw JSON value of input.
Unlike input, this method doesn't throw if the JSON field has an unexpected type.
-
_mcpServerName
final JsonField<String> _mcpServerName()
Returns the raw JSON value of mcpServerName.
Unlike mcpServerName, this method doesn't throw if the JSON field has an unexpected type.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_processedAt
final JsonField<OffsetDateTime> _processedAt()
Returns the raw JSON value of processedAt.
Unlike processedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_evaluatedPermission
final JsonField<BetaManagedAgentsAgentEvaluatedPermission> _evaluatedPermission()
Returns the raw JSON value of evaluatedPermission.
Unlike evaluatedPermission, this method doesn't throw if the JSON field has an unexpected type.
-
_evaluation
final JsonField<BetaManagedAgentsAgentToolEvaluation> _evaluation()
Returns the raw JSON value of evaluation.
Unlike evaluation, this method doesn't throw if the JSON field has an unexpected type.
-
_sessionThreadId
final JsonField<String> _sessionThreadId()
Returns the raw JSON value of sessionThreadId.
Unlike sessionThreadId, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaManagedAgentsAgentMcpToolUseEvent.Builder toBuilder()
-
validate
final BetaManagedAgentsAgentMcpToolUseEvent validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static BetaManagedAgentsAgentMcpToolUseEvent.Builder builder()
Returns a mutable builder for constructing an instance of BetaManagedAgentsAgentMcpToolUseEvent.
The following fields are required:
.id() .input() .mcpServerName() .name() .processedAt()
-
-
-
-