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.
  • Constructor Details

    • McpServer

      public McpServer(String name, String url)
      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 a McpServer record class.
      Parameters:
      type - the value for the type record component
      name - the value for the name record component
      url - the value for the url record component
      headers - the value for the headers record component
      allowedTools - the value for the allowedTools record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public String type()
      Returns the value of the type record component.
      Specified by:
      type in interface Tool
      Returns:
      the value of the type record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • headers

      public Map<String,String> headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component
    • allowedTools

      public List<Tool.AllowedTools> allowedTools()
      Returns the value of the allowedTools record component.
      Returns:
      the value of the allowedTools record component