Class Tool.Mcp
-
- All Implemented Interfaces:
public final class Tool.McpGive 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 classTool.Mcp.BuilderA builder for Mcp.
public final classTool.Mcp.AllowedToolsList of allowed tool names or a filter object.
public final classTool.Mcp.HeadersOptional HTTP headers to send to the MCP server. Use for authentication or other purposes.
public final classTool.Mcp.RequireApprovalSpecify which of the MCP server's tools require approval.
-
Method Summary
Modifier and Type Method Description final StringserverLabel()A label for this MCP server, used to identify it in tool calls. final StringserverUrl()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 Optional<String>serverDescription()Optional description of the MCP server, used to provide more context. 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 JsonField<String>_serverDescription()Returns the raw JSON value of serverDescription. final Map<String, JsonValue>_additionalProperties()final Tool.Mcp.BuildertoBuilder()final Tool.Mcpvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Tool.Mcp.Builderbuilder()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.
-
serverDescription
final Optional<String> serverDescription()
Optional description of the MCP server, used to provide more context.
-
_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.
-
_serverDescription
final JsonField<String> _serverDescription()
Returns the raw JSON value of serverDescription.
Unlike serverDescription, 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()
-
-
-
-