Summary
getAllToolDefinitions() and getAvailableToolNames() in src/registry-manager.ts currently serve a dual purpose:
- Discovery — returning the health-filtered tool list for
tools/list responses (context-only subset in unreachable mode).
- Catalog — used by other consumers (e.g., dashboard metrics) that need a stable count of all registered tools regardless of connection state.
This means that during unreachable mode, any consumer calling getAllToolDefinitions() for informational/metrics purposes will see a reduced, context-only count rather than the full registered tool set.
Proposed Change
Split the API into two distinct methods:
getAllToolDefinitionsCatalog() (or getToolCatalog()) — always returns the full set from toolLookupCache / registries, ignoring isUnreachableMode(). Intended for stable counts, documentation, metrics, etc.
getAllToolDefinitions() — retains current health-filtered behavior (context-only in unreachable mode) for tools/list responses.
Update callers that need stable totals (e.g., dashboard metrics usage of getAllToolDefinitions()) to call the new catalog method instead.
Context
Identified during review of PR #369 (comment).
Splitting discovery/catalog APIs is a larger refactor deferred from PR #369. The current behavior is considered acceptable for the dashboard (informational-only, rebuilds on next health transition), but tracking this here prevents regressions as new consumers of getAllToolDefinitions() are added.
Backlinks
/cc @polaz
Summary
getAllToolDefinitions()andgetAvailableToolNames()insrc/registry-manager.tscurrently serve a dual purpose:tools/listresponses (context-only subset in unreachable mode).This means that during unreachable mode, any consumer calling
getAllToolDefinitions()for informational/metrics purposes will see a reduced, context-only count rather than the full registered tool set.Proposed Change
Split the API into two distinct methods:
getAllToolDefinitionsCatalog()(orgetToolCatalog()) — always returns the full set fromtoolLookupCache/ registries, ignoringisUnreachableMode(). Intended for stable counts, documentation, metrics, etc.getAllToolDefinitions()— retains current health-filtered behavior (context-only in unreachable mode) fortools/listresponses.Update callers that need stable totals (e.g., dashboard metrics usage of
getAllToolDefinitions()) to call the new catalog method instead.Context
Identified during review of PR #369 (comment).
Splitting discovery/catalog APIs is a larger refactor deferred from PR #369. The current behavior is considered acceptable for the dashboard (informational-only, rebuilds on next health transition), but tracking this here prevents regressions as new consumers of
getAllToolDefinitions()are added.Backlinks
/cc @polaz