Class BetaRequestToolAdditionBlock
-
- All Implemented Interfaces:
public final class BetaRequestToolAdditionBlockMid-conversation directive to make a tool available.
`tool`is a reference to a tool (or MCP toolset) declared in the request's`tools`. Under the`inline-tools-2026-09-15`beta it may instead be a reference to a tool defined earlier in`messages`, or a`tool_definition`object that carries an inline tool definition in`definition`(the same object a`tools`entry holds). An`mcp_toolset`definition also requires the`mcp-client-2026-09-15`beta. The tool is offered to the model from this point in the conversation onward.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaRequestToolAdditionBlock.BuilderA builder for BetaRequestToolAdditionBlock.
public final classBetaRequestToolAdditionBlock.Tool
-
Method Summary
Modifier and Type Method Description final BetaRequestToolAdditionBlock.Tooltool()final Optional<BetaCacheControlEphemeral>cacheControl()Create a cache control breakpoint at this content block. final JsonValue_type()Expected to always return the following:
However, this method can be useful for debugging and logging (e.g.JsonValue.from("tool_addition")final JsonField<BetaRequestToolAdditionBlock.Tool>_tool()Returns the raw JSON value of tool. final JsonField<BetaCacheControlEphemeral>_cacheControl()Returns the raw JSON value of cacheControl. final Map<String, JsonValue>_additionalProperties()final BetaRequestToolAdditionBlock.BuildertoBuilder()final BetaRequestToolAdditionBlockvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaRequestToolAdditionBlock.Builderbuilder()Returns a mutable builder for constructing an instance of BetaRequestToolAdditionBlock. final static BetaRequestToolAdditionBlockof(BetaRequestToolAdditionBlock.Tool tool)Returns an immutable instance of BetaRequestToolAdditionBlock with the required tool set to the given value. final static BetaRequestToolAdditionBlockof(BetaToolChangeToolReference reference)Alias for calling of with Tool.ofReference(reference).final static BetaRequestToolAdditionBlockof(BetaResponseToolChangeToolReference reference)Alias for calling of with reference.toParam().final static BetaRequestToolAdditionBlockof(BetaToolChangeMcpToolReference mcpToolReference)Alias for calling of with Tool.ofMcpToolReference(mcpToolReference).final static BetaRequestToolAdditionBlockof(BetaResponseToolChangeMcpToolReference mcpToolReference)Alias for calling of with mcpToolReference.toParam().final static BetaRequestToolAdditionBlockof(BetaToolChangeMcpToolsetReference mcpToolsetReference)Alias for calling of with Tool.ofMcpToolsetReference(mcpToolsetReference).final static BetaRequestToolAdditionBlockof(BetaResponseToolChangeMcpToolsetReference mcpToolsetReference)Alias for calling of with mcpToolsetReference.toParam().final static BetaRequestToolAdditionBlockof(BetaToolChangeToolDefinitionParam definition)Alias for calling of with Tool.ofDefinition(definition).final static BetaRequestToolAdditionBlockof(BetaToolChangeToolDefinition definition)Alias for calling of with definition.toParam().-
-
Method Detail
-
tool
final BetaRequestToolAdditionBlock.Tool tool()
-
cacheControl
final Optional<BetaCacheControlEphemeral> cacheControl()
Create a cache control breakpoint at this content block.
-
_type
final JsonValue _type()
Expected to always return the following:
JsonValue.from("tool_addition")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_tool
final JsonField<BetaRequestToolAdditionBlock.Tool> _tool()
Returns the raw JSON value of tool.
Unlike tool, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheControl
final JsonField<BetaCacheControlEphemeral> _cacheControl()
Returns the raw JSON value of cacheControl.
Unlike cacheControl, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaRequestToolAdditionBlock.Builder toBuilder()
-
validate
final BetaRequestToolAdditionBlock 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 BetaRequestToolAdditionBlock.Builder builder()
Returns a mutable builder for constructing an instance of BetaRequestToolAdditionBlock.
The following fields are required:
.tool()
-
of
final static BetaRequestToolAdditionBlock of(BetaRequestToolAdditionBlock.Tool tool)
Returns an immutable instance of BetaRequestToolAdditionBlock with the required tool set to the given value.
-
of
final static BetaRequestToolAdditionBlock of(BetaToolChangeToolReference reference)
Alias for calling of with
Tool.ofReference(reference).
-
of
final static BetaRequestToolAdditionBlock of(BetaResponseToolChangeToolReference reference)
Alias for calling of with
reference.toParam().
-
of
final static BetaRequestToolAdditionBlock of(BetaToolChangeMcpToolReference mcpToolReference)
Alias for calling of with
Tool.ofMcpToolReference(mcpToolReference).
-
of
final static BetaRequestToolAdditionBlock of(BetaResponseToolChangeMcpToolReference mcpToolReference)
Alias for calling of with
mcpToolReference.toParam().
-
of
final static BetaRequestToolAdditionBlock of(BetaToolChangeMcpToolsetReference mcpToolsetReference)
Alias for calling of with
Tool.ofMcpToolsetReference(mcpToolsetReference).
-
of
final static BetaRequestToolAdditionBlock of(BetaResponseToolChangeMcpToolsetReference mcpToolsetReference)
Alias for calling of with
mcpToolsetReference.toParam().
-
of
final static BetaRequestToolAdditionBlock of(BetaToolChangeToolDefinitionParam definition)
Alias for calling of with
Tool.ofDefinition(definition).
-
of
final static BetaRequestToolAdditionBlock of(BetaToolChangeToolDefinition definition)
Alias for calling of with
definition.toParam().
-
-
-
-