MCPcopy Create free account
hub / github.com/TanStack/ai / resolveFromRegistry

Function resolveFromRegistry

packages/ai-mcp/src/apps/call-handler.ts:195–203  ·  view source on GitHub ↗
(
    serverId: string | undefined,
  )

Source from the content-addressed store, hash-verified

193 // undefined and exactly one descriptor is registered, default to that sole
194 // descriptor; with zero or multiple, undefined stays unresolvable.
195 const resolveFromRegistry = (
196 serverId: string | undefined,
197 ): McpServerDescriptor | null => {
198 if (serverId !== undefined) {
199 return registry.byServerId[serverId] ?? null
200 }
201 if (registry.total !== 1) return null
202 return registry.fallback ?? Object.values(registry.byServerId)[0] ?? null
203 }
204
205 return async (
206 req: McpAppCallRequest,

Callers 1

createMcpAppCallHandlerFunction · 0.85

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected