Class Tool.Mcp
-
- All Implemented Interfaces:
public final class Tool.Mcp
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Tool.Mcp.Builder
A builder for Mcp.
public final class
Tool.Mcp.AllowedTools
List of allowed tool names or a filter object.
public final class
Tool.Mcp.Headers
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
public final class
Tool.Mcp.RequireApproval
Specify which of the MCP server's tools require approval.
-
Method Summary
Modifier and Type Method Description final String
serverLabel()
A label for this MCP server, used to identify it in tool calls. final String
serverUrl()
The URL for the MCP server. final JsonValue
_type()
The type of the MCP tool. final Optional<Tool.Mcp.AllowedTools>
allowedTools()
List of allowed tool names or a filter object. final Optional<Tool.Mcp.Headers>
headers()
Optional HTTP headers to send to the MCP server. final Optional<Tool.Mcp.RequireApproval>
requireApproval()
Specify which of the MCP server's tools require approval. final JsonField<String>
_serverLabel()
Returns the raw JSON value of serverLabel. final JsonField<String>
_serverUrl()
Returns the raw JSON value of serverUrl. final JsonField<Tool.Mcp.AllowedTools>
_allowedTools()
Returns the raw JSON value of allowedTools. final JsonField<Tool.Mcp.Headers>
_headers()
Returns the raw JSON value of headers. final JsonField<Tool.Mcp.RequireApproval>
_requireApproval()
Returns the raw JSON value of requireApproval. final Map<String, JsonValue>
_additionalProperties()
final Tool.Mcp.Builder
toBuilder()
final Tool.Mcp
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Tool.Mcp.Builder
builder()
Returns a mutable builder for constructing an instance of Mcp. -
-
Method Detail
-
serverLabel
final String serverLabel()
A label for this MCP server, used to identify it in tool calls.
-
_type
final JsonValue _type()
The type of the MCP tool. 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).
-
allowedTools
final Optional<Tool.Mcp.AllowedTools> allowedTools()
List of allowed tool names or a filter object.
-
headers
final Optional<Tool.Mcp.Headers> headers()
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
requireApproval
final Optional<Tool.Mcp.RequireApproval> requireApproval()
Specify which of the MCP server's tools require approval.
-
_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.
-
_serverUrl
final JsonField<String> _serverUrl()
Returns the raw JSON value of serverUrl.
Unlike serverUrl, this method doesn't throw if the JSON field has an unexpected type.
-
_allowedTools
final JsonField<Tool.Mcp.AllowedTools> _allowedTools()
Returns the raw JSON value of allowedTools.
Unlike allowedTools, this method doesn't throw if the JSON field has an unexpected type.
-
_headers
final JsonField<Tool.Mcp.Headers> _headers()
Returns the raw JSON value of headers.
Unlike headers, this method doesn't throw if the JSON field has an unexpected type.
-
_requireApproval
final JsonField<Tool.Mcp.RequireApproval> _requireApproval()
Returns the raw JSON value of requireApproval.
Unlike requireApproval, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Tool.Mcp.Builder toBuilder()
-
builder
final static Tool.Mcp.Builder builder()
Returns a mutable builder for constructing an instance of Mcp.
The following fields are required:
.serverLabel() .serverUrl()
-
-
-
-