Package com.openai.models.responses
Class ToolChoiceMcp
-
- All Implemented Interfaces:
public final class ToolChoiceMcp
Use this option to force the model to call a specific tool on a remote MCP server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ToolChoiceMcp.Builder
A builder for ToolChoiceMcp.
-
Method Summary
Modifier and Type Method Description final String
serverLabel()
The label of the MCP server to use. final JsonValue
_type()
For MCP tools, the type is always mcp
.final Optional<String>
name()
The name of the tool to call on the server. final JsonField<String>
_serverLabel()
Returns the raw JSON value of serverLabel. final JsonField<String>
_name()
Returns the raw JSON value of name. final Map<String, JsonValue>
_additionalProperties()
final ToolChoiceMcp.Builder
toBuilder()
final ToolChoiceMcp
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ToolChoiceMcp.Builder
builder()
Returns a mutable builder for constructing an instance of ToolChoiceMcp. -
-
Method Detail
-
serverLabel
final String serverLabel()
The label of the MCP server to use.
-
_type
final JsonValue _type()
For MCP tools, the type is always
mcp
.Expected to always return the following:
JsonValue.from("mcp")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_serverLabel
final JsonField<String> _serverLabel()
Returns the raw JSON value of serverLabel.
Unlike serverLabel, 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.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ToolChoiceMcp.Builder toBuilder()
-
validate
final ToolChoiceMcp validate()
-
builder
final static ToolChoiceMcp.Builder builder()
Returns a mutable builder for constructing an instance of ToolChoiceMcp.
The following fields are required:
.serverLabel()
-
-
-
-