Record Class McpToolGrantRequest

java.lang.Object
java.lang.Record
io.meeds.mcp.server.model.McpToolGrantRequest
Record Components:
requestId - the call identifier, also the approval request id
username - the user the tool runs as
toolName - the MCP tool name (snake case)
toolInput - the call arguments as received (JSON)
agentNameId - the calling agent, or null when unknown
conversationId - the chat conversation, or null outside a chat
clientId - the OAuth client that owns the token, may be null
retry - whether the call belongs to a retried answer
actingIdentity - who executes the call, for whom and through which agents, or null when the server resolved none; username is its subject and agentNameId its grant scope

public record McpToolGrantRequest(String requestId, String username, String toolName, String toolInput, String agentNameId, String conversationId, String clientId, boolean retry, ActingIdentity actingIdentity) extends Record
One tool call as the MCP server resolved it, the input of every standing approval decision. Each field comes from the server's own resolution of the call (the token, the trusted internal-client headers, the call input), never from an approval answer: a grant chosen on a card is built from this record, so the card can only pick a scope and an expiry.
  • Constructor Details

    • McpToolGrantRequest

      public McpToolGrantRequest(String requestId, String username, String toolName, String toolInput, String agentNameId, String conversationId, String clientId, boolean retry)
      A call with no resolved acting identity (actingIdentity null).
      Parameters:
      requestId - the call identifier
      username - the user the tool runs as
      toolName - the MCP tool name (snake case)
      toolInput - the call arguments as received (JSON)
      agentNameId - the calling agent, or null when unknown
      conversationId - the chat conversation, or null outside a chat
      clientId - the OAuth client that owns the token, may be null
      retry - whether the call belongs to a retried answer
    • McpToolGrantRequest

      public McpToolGrantRequest(String requestId, String username, String toolName, String toolInput, String agentNameId, String conversationId, String clientId, boolean retry, ActingIdentity actingIdentity)
      Creates an instance of a McpToolGrantRequest record class.
      Parameters:
      requestId - the value for the requestId record component
      username - the value for the username record component
      toolName - the value for the toolName record component
      toolInput - the value for the toolInput record component
      agentNameId - the value for the agentNameId record component
      conversationId - the value for the conversationId record component
      clientId - the value for the clientId record component
      retry - the value for the retry record component
      actingIdentity - the value for the actingIdentity 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • requestId

      public String requestId()
      Returns the value of the requestId record component.
      Returns:
      the value of the requestId record component
    • username

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • toolName

      public String toolName()
      Returns the value of the toolName record component.
      Returns:
      the value of the toolName record component
    • toolInput

      public String toolInput()
      Returns the value of the toolInput record component.
      Returns:
      the value of the toolInput record component
    • agentNameId

      public String agentNameId()
      Returns the value of the agentNameId record component.
      Returns:
      the value of the agentNameId record component
    • conversationId

      public String conversationId()
      Returns the value of the conversationId record component.
      Returns:
      the value of the conversationId record component
    • clientId

      public String clientId()
      Returns the value of the clientId record component.
      Returns:
      the value of the clientId record component
    • retry

      public boolean retry()
      Returns the value of the retry record component.
      Returns:
      the value of the retry record component
    • actingIdentity

      public ActingIdentity actingIdentity()
      Returns the value of the actingIdentity record component.
      Returns:
      the value of the actingIdentity record component