Hermes.Client.Operation (hermes_mcp v0.9.1)

Represents an operation to be performed by the MCP client.

This struct encapsulates all information about a client API call:

  • method - The MCP method to call
  • params - The parameters to send to the server
  • progress_opts - Progress tracking options (optional)
  • timeout - The timeout for this specific operation (default: 30 seconds)

Summary

Functions

Creates a new operation struct.

Types

progress_options()

@type progress_options() :: [
  token: String.t() | integer(),
  callback: (String.t() | integer(), number(), number() | nil -> any())
]

t()

@type t() :: %Hermes.Client.Operation{
  method: String.t(),
  params: map(),
  progress_opts: progress_options() | nil,
  timeout: pos_integer()
}

Functions

new(attrs)

@spec new(%{
  :method => String.t(),
  optional(:params) => map(),
  optional(:progress_opts) => progress_options() | nil,
  optional(:timeout) => pos_integer()
}) :: t()

Creates a new operation struct.

Parameters

  • attrs - Map containing the operation attributes
    • :method - The MCP method name (required)
    • :params - The parameters to send to the server (required)
    • :progress_opts - Progress tracking options (optional)
    • :timeout - The timeout for this operation in milliseconds (optional, defaults to 30s)