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

Unlike get / resource_schema (strict kwargs pre-gem), the pre-gem resources tool tolerated ANY extra argument — so this one stays tolerant.



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/mcp_toolkit/authority/tools/resources.rb', line 22

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