MCPcopy Create free account
hub / github.com/Noumena-Network/code / getReachableProfilesByName

Function getReachableProfilesByName

src/tools/toolImplementationInventory.ts:247–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247function getReachableProfilesByName(): Map<string, ToolImplementationProfileId[]> {
248 if (cachedReachabilityByProfile === null) {
249 cachedReachabilityByProfile = new Map(
250 TOOL_IMPLEMENTATION_PROFILES.map(profile => [
251 profile.id,
252 probeProfileBaseTools(profile),
253 ]),
254 )
255 }
256
257 const byName = new Map<string, ToolImplementationProfileId[]>()
258 for (const [profileId, tools] of cachedReachabilityByProfile) {
259 for (const toolName of tools) {
260 const reachableProfiles = byName.get(toolName) ?? []
261 reachableProfiles.push(profileId)
262 byName.set(toolName, reachableProfiles)
263 }
264 }
265
266 // StructuredOutput is a special noninteractive tool and is exercised by the
267 // smoke harness whenever a JSON schema is provided.
268 byName.set('StructuredOutput', ['structured_output_noninteractive'])
269
270 return byName
271}
272
273function probeProfileBaseTools(profile: ToolImplementationProfile): Set<string> {
274 const script = [

Callers 1

Calls 3

probeProfileBaseToolsFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected