Class BetaTool.Mcp.Builder
-
- All Implemented Interfaces:
public final class BetaTool.Mcp.BuilderA builder for Mcp.
-
-
Method Summary
Modifier and Type Method Description final BetaTool.Mcp.BuilderserverLabel(String serverLabel)A label for this MCP server, used to identify it in tool calls. final BetaTool.Mcp.BuilderserverLabel(JsonField<String> serverLabel)Sets Builder.serverLabel to an arbitrary JSON value. final BetaTool.Mcp.Buildertype(JsonValue type)Sets the field to an arbitrary JSON value. final BetaTool.Mcp.BuilderallowedCallers(List<BetaTool.Mcp.AllowedCaller> allowedCallers)The tool invocation context(s). final BetaTool.Mcp.BuilderallowedCallers(Optional<List<BetaTool.Mcp.AllowedCaller>> allowedCallers)Alias for calling Builder.allowedCallers with allowedCallers.orElse(null).final BetaTool.Mcp.BuilderallowedCallers(JsonField<List<BetaTool.Mcp.AllowedCaller>> allowedCallers)Sets Builder.allowedCallers to an arbitrary JSON value. final BetaTool.Mcp.BuilderaddAllowedCaller(BetaTool.Mcp.AllowedCaller allowedCaller)Adds a single AllowedCaller to allowedCallers. final BetaTool.Mcp.BuilderallowedTools(BetaTool.Mcp.AllowedTools allowedTools)List of allowed tool names or a filter object. final BetaTool.Mcp.BuilderallowedTools(Optional<BetaTool.Mcp.AllowedTools> allowedTools)Alias for calling Builder.allowedTools with allowedTools.orElse(null).final BetaTool.Mcp.BuilderallowedTools(JsonField<BetaTool.Mcp.AllowedTools> allowedTools)Sets Builder.allowedTools to an arbitrary JSON value. final BetaTool.Mcp.BuilderallowedTools(BetaTool.Mcp.AllowedTools.McpToolFilter mcpToolFilter)Alias for calling allowedTools with AllowedTools.ofMcpToolFilter(mcpToolFilter).final BetaTool.Mcp.BuilderallowedToolsOfMcp(List<String> mcp)Alias for calling allowedTools with AllowedTools.ofMcp(mcp).final BetaTool.Mcp.Builderauthorization(String authorization)An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. final BetaTool.Mcp.Builderauthorization(JsonField<String> authorization)Sets Builder.authorization to an arbitrary JSON value. final BetaTool.Mcp.BuilderconnectorId(BetaTool.Mcp.ConnectorId connectorId)Identifier for service connectors, like those available in ChatGPT. final BetaTool.Mcp.BuilderconnectorId(JsonField<BetaTool.Mcp.ConnectorId> connectorId)Sets Builder.connectorId to an arbitrary JSON value. final BetaTool.Mcp.BuilderdeferLoading(Boolean deferLoading)Whether this MCP tool is deferred and discovered via tool search. final BetaTool.Mcp.BuilderdeferLoading(JsonField<Boolean> deferLoading)Sets Builder.deferLoading to an arbitrary JSON value. final BetaTool.Mcp.Builderheaders(BetaTool.Mcp.Headers headers)Optional HTTP headers to send to the MCP server. final BetaTool.Mcp.Builderheaders(Optional<BetaTool.Mcp.Headers> headers)Alias for calling Builder.headers with headers.orElse(null).final BetaTool.Mcp.Builderheaders(JsonField<BetaTool.Mcp.Headers> headers)Sets Builder.headers to an arbitrary JSON value. final BetaTool.Mcp.BuilderrequireApproval(BetaTool.Mcp.RequireApproval requireApproval)Specify which of the MCP server's tools require approval. final BetaTool.Mcp.BuilderrequireApproval(Optional<BetaTool.Mcp.RequireApproval> requireApproval)Alias for calling Builder.requireApproval with requireApproval.orElse(null).final BetaTool.Mcp.BuilderrequireApproval(JsonField<BetaTool.Mcp.RequireApproval> requireApproval)Sets Builder.requireApproval to an arbitrary JSON value. final BetaTool.Mcp.BuilderrequireApproval(BetaTool.Mcp.RequireApproval.McpToolApprovalFilter mcpToolApprovalFilter)Alias for calling requireApproval with RequireApproval.ofMcpToolApprovalFilter(mcpToolApprovalFilter).final BetaTool.Mcp.BuilderrequireApproval(BetaTool.Mcp.RequireApproval.McpToolApprovalSetting mcpToolApprovalSetting)Alias for calling requireApproval with RequireApproval.ofMcpToolApprovalSetting(mcpToolApprovalSetting).final BetaTool.Mcp.BuilderserverDescription(String serverDescription)Optional description of the MCP server, used to provide more context. final BetaTool.Mcp.BuilderserverDescription(JsonField<String> serverDescription)Sets Builder.serverDescription to an arbitrary JSON value. final BetaTool.Mcp.BuilderserverUrl(String serverUrl)The URL for the MCP server. final BetaTool.Mcp.BuilderserverUrl(JsonField<String> serverUrl)Sets Builder.serverUrl to an arbitrary JSON value. final BetaTool.Mcp.BuildertunnelId(String tunnelId)The Secure MCP Tunnel ID to use instead of a direct server URL. final BetaTool.Mcp.BuildertunnelId(JsonField<String> tunnelId)Sets Builder.tunnelId to an arbitrary JSON value. final BetaTool.Mcp.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final BetaTool.Mcp.BuilderputAdditionalProperty(String key, JsonValue value)final BetaTool.Mcp.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final BetaTool.Mcp.BuilderremoveAdditionalProperty(String key)final BetaTool.Mcp.BuilderremoveAllAdditionalProperties(Set<String> keys)final BetaTool.Mcpbuild()Returns an immutable instance of Mcp. -
-
Method Detail
-
serverLabel
final BetaTool.Mcp.Builder serverLabel(String serverLabel)
A label for this MCP server, used to identify it in tool calls.
-
serverLabel
final BetaTool.Mcp.Builder serverLabel(JsonField<String> serverLabel)
Sets Builder.serverLabel to an arbitrary JSON value.
You should usually call Builder.serverLabel with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final BetaTool.Mcp.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("mcp")This method is primarily for setting the field to an undocumented or not yet supported value.
-
allowedCallers
final BetaTool.Mcp.Builder allowedCallers(List<BetaTool.Mcp.AllowedCaller> allowedCallers)
The tool invocation context(s).
-
allowedCallers
final BetaTool.Mcp.Builder allowedCallers(Optional<List<BetaTool.Mcp.AllowedCaller>> allowedCallers)
Alias for calling Builder.allowedCallers with
allowedCallers.orElse(null).
-
allowedCallers
final BetaTool.Mcp.Builder allowedCallers(JsonField<List<BetaTool.Mcp.AllowedCaller>> allowedCallers)
Sets Builder.allowedCallers to an arbitrary JSON value.
You should usually call Builder.allowedCallers with a well-typed
List<AllowedCaller>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addAllowedCaller
final BetaTool.Mcp.Builder addAllowedCaller(BetaTool.Mcp.AllowedCaller allowedCaller)
Adds a single AllowedCaller to allowedCallers.
-
allowedTools
final BetaTool.Mcp.Builder allowedTools(BetaTool.Mcp.AllowedTools allowedTools)
List of allowed tool names or a filter object.
-
allowedTools
final BetaTool.Mcp.Builder allowedTools(Optional<BetaTool.Mcp.AllowedTools> allowedTools)
Alias for calling Builder.allowedTools with
allowedTools.orElse(null).
-
allowedTools
final BetaTool.Mcp.Builder allowedTools(JsonField<BetaTool.Mcp.AllowedTools> allowedTools)
Sets Builder.allowedTools to an arbitrary JSON value.
You should usually call Builder.allowedTools with a well-typed AllowedTools value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
allowedTools
final BetaTool.Mcp.Builder allowedTools(BetaTool.Mcp.AllowedTools.McpToolFilter mcpToolFilter)
Alias for calling allowedTools with
AllowedTools.ofMcpToolFilter(mcpToolFilter).
-
allowedToolsOfMcp
final BetaTool.Mcp.Builder allowedToolsOfMcp(List<String> mcp)
Alias for calling allowedTools with
AllowedTools.ofMcp(mcp).
-
authorization
final BetaTool.Mcp.Builder authorization(String authorization)
An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
authorization
final BetaTool.Mcp.Builder authorization(JsonField<String> authorization)
Sets Builder.authorization to an arbitrary JSON value.
You should usually call Builder.authorization with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
connectorId
final BetaTool.Mcp.Builder connectorId(BetaTool.Mcp.ConnectorId connectorId)
Identifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:Dropbox:
connector_dropboxGmail:
connector_gmailGoogle Calendar:
connector_googlecalendarGoogle Drive:
connector_googledriveMicrosoft Teams:
connector_microsoftteamsOutlook Calendar:
connector_outlookcalendarOutlook Email:
connector_outlookemailSharePoint:
connector_sharepoint
-
connectorId
final BetaTool.Mcp.Builder connectorId(JsonField<BetaTool.Mcp.ConnectorId> connectorId)
Sets Builder.connectorId to an arbitrary JSON value.
You should usually call Builder.connectorId with a well-typed ConnectorId value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
deferLoading
final BetaTool.Mcp.Builder deferLoading(Boolean deferLoading)
Whether this MCP tool is deferred and discovered via tool search.
-
deferLoading
final BetaTool.Mcp.Builder deferLoading(JsonField<Boolean> deferLoading)
Sets Builder.deferLoading to an arbitrary JSON value.
You should usually call Builder.deferLoading with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
headers
final BetaTool.Mcp.Builder headers(BetaTool.Mcp.Headers headers)
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
headers
final BetaTool.Mcp.Builder headers(Optional<BetaTool.Mcp.Headers> headers)
Alias for calling Builder.headers with
headers.orElse(null).
-
headers
final BetaTool.Mcp.Builder headers(JsonField<BetaTool.Mcp.Headers> headers)
Sets Builder.headers to an arbitrary JSON value.
You should usually call Builder.headers with a well-typed Headers value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
requireApproval
final BetaTool.Mcp.Builder requireApproval(BetaTool.Mcp.RequireApproval requireApproval)
Specify which of the MCP server's tools require approval.
-
requireApproval
final BetaTool.Mcp.Builder requireApproval(Optional<BetaTool.Mcp.RequireApproval> requireApproval)
Alias for calling Builder.requireApproval with
requireApproval.orElse(null).
-
requireApproval
final BetaTool.Mcp.Builder requireApproval(JsonField<BetaTool.Mcp.RequireApproval> requireApproval)
Sets Builder.requireApproval to an arbitrary JSON value.
You should usually call Builder.requireApproval with a well-typed RequireApproval value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
requireApproval
final BetaTool.Mcp.Builder requireApproval(BetaTool.Mcp.RequireApproval.McpToolApprovalFilter mcpToolApprovalFilter)
Alias for calling requireApproval with
RequireApproval.ofMcpToolApprovalFilter(mcpToolApprovalFilter).
-
requireApproval
final BetaTool.Mcp.Builder requireApproval(BetaTool.Mcp.RequireApproval.McpToolApprovalSetting mcpToolApprovalSetting)
Alias for calling requireApproval with
RequireApproval.ofMcpToolApprovalSetting(mcpToolApprovalSetting).
-
serverDescription
final BetaTool.Mcp.Builder serverDescription(String serverDescription)
Optional description of the MCP server, used to provide more context.
-
serverDescription
final BetaTool.Mcp.Builder serverDescription(JsonField<String> serverDescription)
Sets Builder.serverDescription to an arbitrary JSON value.
You should usually call Builder.serverDescription with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
serverUrl
final BetaTool.Mcp.Builder serverUrl(String serverUrl)
The URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided.
-
serverUrl
final BetaTool.Mcp.Builder serverUrl(JsonField<String> serverUrl)
Sets Builder.serverUrl to an arbitrary JSON value.
You should usually call Builder.serverUrl with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
tunnelId
final BetaTool.Mcp.Builder tunnelId(String tunnelId)
The Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
tunnelId
final BetaTool.Mcp.Builder tunnelId(JsonField<String> tunnelId)
Sets Builder.tunnelId to an arbitrary JSON value.
You should usually call Builder.tunnelId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final BetaTool.Mcp.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final BetaTool.Mcp.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final BetaTool.Mcp.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final BetaTool.Mcp.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final BetaTool.Mcp.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final BetaTool.Mcp build()
Returns an immutable instance of Mcp.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.serverLabel()
-
-
-
-