Record Class Tool.McpServer
java.lang.Object
java.lang.Record
io.github.glaforge.gemini.interactions.model.Tool.McpServer
- Record Components:
type- The type of tool (must be "mcp_server").name- The name of the MCP server.url- The URL of the MCP server.headers- Headers for the MCP server connection.allowedTools- List of allowed tools on the server.
- All Implemented Interfaces:
Tool
- Enclosing interface:
Tool
public static record Tool.McpServer(String type, String name, String url, Map<String,String> headers, List<Tool.AllowedTools> allowedTools)
extends Record
implements Tool
Tool definition for an MCP Server.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.glaforge.gemini.interactions.model.Tool
Tool.AllowedTools, Tool.CodeExecution, Tool.ComputerUse, Tool.FileSearch, Tool.Function, Tool.GoogleSearch, Tool.McpServer, Tool.Mode, Tool.ToolChoiceConfig, Tool.UrlContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedToolsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.url()Returns the value of theurlrecord component.
-
Constructor Details
-
McpServer
Creates a new McpServer tool.- Parameters:
name- The name of the MCP server.url- The URL of the MCP server.
-
McpServer
public McpServer(String type, String name, String url, Map<String, String> headers, List<Tool.AllowedTools> allowedTools) Creates an instance of aMcpServerrecord class.- Parameters:
type- the value for thetyperecord componentname- the value for thenamerecord componenturl- the value for theurlrecord componentheaders- the value for theheadersrecord componentallowedTools- the value for theallowedToolsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-
allowedTools
Returns the value of theallowedToolsrecord component.- Returns:
- the value of the
allowedToolsrecord component
-