Class JsonRpcRequest

java.lang.Object
org.apache.juneau.bean.jsonrpc.JsonRpcRequest

@Marshalled public class JsonRpcRequest extends Object
JSON-RPC 2.0 request envelope.

The id field may be a String, integral Number, or null (notification).

This envelope is generic JSON-RPC 2.0 and carries no _meta property: MCP-specific per-request metadata belongs under params._meta, not beside the envelope. See the 2026-07-28 v2 bean package (org.apache.juneau.bean.mcp.v20260728) for the typed nested carrier.

  • Constructor Details

  • Method Details

    • getJsonrpc

      public String getJsonrpc()
      JSON-RPC protocol version (typically "2.0").
      Returns:
      The version token, or null if not set.
    • setJsonrpc

      Sets the JSON-RPC protocol version.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • getId

      public Object getId()
      Request identifier (string, integer, or null for notifications).
      Returns:
      The id, or null if not set.
    • setId

      public JsonRpcRequest setId(Object value)
      Sets the request id.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • getMethod

      public String getMethod()
      JSON-RPC method name (for example "tools/list").
      Returns:
      The method, or null if not set.
    • setMethod

      Sets the JSON-RPC method name.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • getParams

      public Object getParams()
      Method parameters (object, array, or null).
      Returns:
      The params payload, or null if not set.
    • setParams

      Sets method parameters.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).