Class: McpToolkit::Authority::Tools::Get

Inherits:
Base
  • Object
show all
Defined in:
lib/mcp_toolkit/authority/tools/get.rb

Overview

Authority-path tool: fetch a single record by id from a registered resource, scoped to the caller's resolved account. Gates a superuser-only resource, the resource's required scope, and requires a selected account before reading.

Instance Method Summary collapse

Instance Method Details

#call(context:, resource: nil, id: nil, fields: nil, **_args) ⇒ Object



48
49
50
51
52
53
54
55
56
57
# File 'lib/mcp_toolkit/authority/tools/get.rb', line 48

def call(context:, resource: nil, id: nil, fields: nil, **_args)
  descriptor = resolve_descriptor(resource)
  ensure_resource_accessible!(descriptor, context)
  ensure_scope!(descriptor, context)
  ensure_account!(context)

  run_executor do
    McpToolkit::GetExecutor.call(resource: descriptor, scope_root: context., id:, fields:)
  end
end