Class: LittleGhost::MCP::Call

Inherits:
Data
  • Object
show all
Defined in:
lib/little_ghost/mcp/types.rb,
lib/little_ghost/mcp/types.rb

Overview

Describes one MCP Tool invocation. It combines the server's Definition, the copied arguments, and the Tool::Binding used to execute the generated Tool.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition:, arguments:, context: nil, binding: Tool::Binding.new) ⇒ Call

Returns a new instance of Call.

Raises:

  • (ArgumentError)


133
134
135
136
137
138
139
140
141
142
# File 'lib/little_ghost/mcp/types.rb', line 133

def initialize(definition:, arguments:, context: nil, binding: Tool::Binding.new)
  raise ArgumentError, "definition must be a LittleGhost::MCP::Definition" unless definition.is_a?(Definition)

  super(
    definition:,
    arguments: ImmutableValue.mapping(arguments, field: "tool call arguments"),
    context:,
    binding:
  )
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments

Returns:

  • (Object)

    the current value of arguments



132
133
134
# File 'lib/little_ghost/mcp/types.rb', line 132

def arguments
  @arguments
end

#bindingObject (readonly)

Returns the value of attribute binding

Returns:

  • (Object)

    the current value of binding



132
133
134
# File 'lib/little_ghost/mcp/types.rb', line 132

def binding
  @binding
end

#contextObject (readonly)

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



132
133
134
# File 'lib/little_ghost/mcp/types.rb', line 132

def context
  @context
end

#definitionObject (readonly)

Returns the value of attribute definition

Returns:

  • (Object)

    the current value of definition



132
133
134
# File 'lib/little_ghost/mcp/types.rb', line 132

def definition
  @definition
end