Record Class McpOperationContext
java.lang.Object
java.lang.Record
org.apache.juneau.rest.server.mcp.v20260728.McpOperationContext
- Record Components:
method- The JSON-RPC method. Nevernull.name- The operation name (tool/prompt name or resource URI), ornullfor methods without one.params- A read-only view of the raw JSON-RPC request params. Nevernull.
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.name()Returns the value of thenamerecord component.params()Returns the value of theparamsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpOperationContext
Compact constructor enforcing a non-null method and defensively copying the params to a read-only map.
-
-
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
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). -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
params
Returns the value of theparamsrecord component.- Returns:
- the value of the
paramsrecord component
-