Class: SolidLoop::Mcp::CallContext

Inherits:
Struct
  • Object
show all
Defined in:
lib/solid_loop/mcp/call_context.rb

Overview

Caller identity handed to Transport#deliver. HTTP transports typically ignore it (auth travels in headers); in-process transports use it to reach domain state without a network hop.

Two caller shapes (see docs/decisions/mcp-server.md):

in-process agent      — agent/loop set, principal from Base#mcp_principal
external via Server   — agent/loop nil, principal = authorizer's return

Handlers must not assume agent/loop are present.

idempotency_key: stable per-ToolCall key for tools/call dispatches (nil for non-tool traffic such as initialize/list). It also travels on the wire as _meta["solidloop/idempotencyKey"]; handlers of irreversible tools should dedupe on it because a crash between a remote side effect and SolidLoop's executed_at checkpoint can re-deliver the invocation.

Instance Attribute Summary collapse

Instance Attribute Details

#agentObject

Returns the value of attribute agent

Returns:

  • (Object)

    the current value of agent



17
18
19
# File 'lib/solid_loop/mcp/call_context.rb', line 17

def agent
  @agent
end

#idempotency_keyObject

Returns the value of attribute idempotency_key

Returns:

  • (Object)

    the current value of idempotency_key



17
18
19
# File 'lib/solid_loop/mcp/call_context.rb', line 17

def idempotency_key
  @idempotency_key
end

#loopObject

Returns the value of attribute loop

Returns:

  • (Object)

    the current value of loop



17
18
19
# File 'lib/solid_loop/mcp/call_context.rb', line 17

def loop
  @loop
end

#principalObject

Returns the value of attribute principal

Returns:

  • (Object)

    the current value of principal



17
18
19
# File 'lib/solid_loop/mcp/call_context.rb', line 17

def principal
  @principal
end