Class: McpToolkit::Authority::Tools::Resources

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

Overview

Authority-path discovery tool: lists every read-only resource registered in the config's Registry, HIDING superuser-only resources from a non-superuser caller (so they are neither advertised nor discoverable without a superuser token).

The top-level list is context-independent except for that visibility filter, so the tool takes no arguments and does no per-resource scope check (per-resource scopes are enforced by get / list / resource_schema).

Instance Method Summary collapse

Instance Method Details

#call(context:, **_args) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/mcp_toolkit/authority/tools/resources.rb', line 19

def call(context:, **_args)
  {
    resources: visible_resources(context).map do |resource|
      { name: resource.name, description: resource.description }
    end
  }
end