Class: McpToolkit::Authority::Tools::ResourceSchema

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

Overview

Authority-path discovery tool: the detailed schema (attributes with types + filter operators, relationships, filters, note) of one registered resource.

Reveals shape, not tenant data, so it does NOT require a selected account — but it still gates a superuser-only resource (refuse) and the resource's required scope, so a caller can't discover the shape of something it can't read.

Instance Method Summary collapse

Instance Method Details

#call(context:, resource: nil, **extra) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/mcp_toolkit/authority/tools/resource_schema.rb', line 44

def call(context:, resource: nil, **extra)
  reject_unknown_arguments!(extra.except(:account_id))
  descriptor = resolve_descriptor(resource)
  ensure_resource_accessible!(descriptor, context)
  ensure_scope!(descriptor, context)

  McpToolkit::ResourceSchema.call(descriptor, registry:)
end