Hermes.Client.Request (hermes_mcp v0.9.1)

Represents a pending request in the MCP client.

This struct encapsulates all information about an in-progress request:

  • id - The unique request ID
  • method - The MCP method being called
  • from - The GenServer caller reference
  • timer_ref - Reference to the request-specific timeout timer
  • start_time - When the request started (monotonic time in milliseconds)

Summary

Functions

Calculates the elapsed time for a request in milliseconds.

Creates a new request struct.

Types

t()

@type t() :: %Hermes.Client.Request{
  from: GenServer.from(),
  id: String.t(),
  method: String.t(),
  start_time: integer(),
  timer_ref: reference()
}

Functions

elapsed_time(request)

@spec elapsed_time(t()) :: integer()

Calculates the elapsed time for a request in milliseconds.

new(map)

@spec new(%{
  id: String.t(),
  method: String.t(),
  from: GenServer.from(),
  timer_ref: reference()
}) :: t()

Creates a new request struct.

Parameters

  • attrs - Map containing the request attributes
    • :id - The unique request ID
    • :method - The MCP method name
    • :from - The GenServer caller reference
    • :timer_ref - Reference to the request-specific timeout timer