Noizu.MCP.Server.Features.Resources (Noizu MCP v0.1.0)

Copy Markdown View Source

Resources feature plumbing: the helpers behind the generated handle_list_resources/2, handle_list_resource_templates/2, handle_read_resource/2, and handle_subscribe/2 defaults.

Most servers never call this module directly. Hand-written list callbacks that still want the registry-driven behavior can call list_registered/5 and list_registered_templates/3 — e.g. with include_hidden: true for session-gated visibility (see the Toolkits, Categories & Hidden Tools guide).

Direct resources match by exact URI; templates match via Noizu.MCP.UriTemplate.

Summary

Functions

Subscribe check for the default handle_subscribe: the URI must exist and be subscribable.

A resource module's effective definition with per-registration overrides applied.

Default handle_read_resource: exact URI match, then template match.

Returns true if the registered resource should be hidden from listings.

Returns true if the registered resource template should be hidden from listings.

Default handle_list_resources: registered resources + enumerable templates.

Default handle_list_resource_templates over registered template modules.

Functions

check_subscribe(resources, templates, uri)

Subscribe check for the default handle_subscribe: the URI must exist and be subscribable.

definition(module, opts)

A resource module's effective definition with per-registration overrides applied.

dispatch_read(resources, templates, uri, ctx)

Default handle_read_resource: exact URI match, then template match.

hidden?(arg)

Returns true if the registered resource should be hidden from listings.

hidden_template?(arg)

Returns true if the registered resource template should be hidden from listings.

list(server, params, ctx)

list_registered(resources, templates, cursor, ctx, opts \\ [])

Default handle_list_resources: registered resources + enumerable templates.

list_registered_templates(templates, cursor, opts \\ [])

Default handle_list_resource_templates over registered template modules.

list_templates(server, params, ctx)

read(server, params, ctx)