Record Class McpOperationContext

java.lang.Object
java.lang.Record
org.apache.juneau.rest.server.mcp.v20260728.McpOperationContext
Record Components:
method - The JSON-RPC method. Never null.
name - The operation name (tool/prompt name or resource URI), or null for methods without one.
params - A read-only view of the raw JSON-RPC request params. Never null.

public record McpOperationContext(String method, String name, Map<String,Object> params) extends Record
The resolved MCP operation an McpOperationScopeResolver decides required scopes for (SEP-2350 per-operation step-up).

Carries the JSON-RPC method (e.g. tools/call), the operation name (the tool / prompt name or resource URI, as returned by the revision's routing-name derivation), and an opaque read-only view of the raw JSON-RPC request params. A static per-operation scope map keys on (method, name); the params view is the seam a future dynamic resolver could consult (not built for 10.0).

params is the raw JSON-RPC params object, not the unwrapped tool-call arguments: for a tools/call request it is {"name":<tool>, "arguments":{...}}, so a resolver reads the tool arguments via ctx.params().get("arguments") rather than treating params as the argument map itself.

Since:
10.0.0
  • Constructor Details

  • 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.
    • method

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

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

      public Map<String,Object> params()
      Returns the value of the params record component.
      Returns:
      the value of the params record component