MCPcopy Index your code
hub / github.com/Noumena-Network/code / buildAllTools

Function buildAllTools

src/cli/print.ts:1487–1517  ·  view source on GitHub ↗
(appState: AppState)

Source from the content-addressed store, hash-verified

1485 // Closes over the mutable sdkTools/dynamicMcpState bindings so both call
1486 // sites see late-connecting servers.
1487 const buildAllTools = (appState: AppState): Tools => {
1488 const assembledTools = assembleToolPool(
1489 appState.toolPermissionContext,
1490 appState.mcp.tools,
1491 )
1492 const initialTools = filterToolsByDenyRules(
1493 [...tools, ...sdkTools, ...dynamicMcpState.tools],
1494 appState.toolPermissionContext,
1495 )
1496 let allTools = uniqBy(
1497 mergeAndFilterTools(
1498 initialTools,
1499 assembledTools,
1500 appState.toolPermissionContext.mode,
1501 ),
1502 'name',
1503 )
1504 if (options.permissionPromptToolName) {
1505 allTools = allTools.filter(
1506 tool => !toolMatchesName(tool, options.permissionPromptToolName!),
1507 )
1508 }
1509 const initJsonSchema = getInitJsonSchema()
1510 if (initJsonSchema && !options.jsonSchema) {
1511 const syntheticOutputResult = createSyntheticOutputTool(initJsonSchema)
1512 if ('tool' in syntheticOutputResult) {
1513 allTools = [...allTools, syntheticOutputResult.tool]
1514 }
1515 }
1516 return allTools
1517 }
1518
1519 // Bridge handle for remote-control (SDK control message).
1520 // Mirrors the REPL's useReplBridge hook: the handle is created when

Callers 2

drainCommandQueueFunction · 0.85
runHeadlessStreamingFunction · 0.85

Calls 6

assembleToolPoolFunction · 0.85
filterToolsByDenyRulesFunction · 0.85
mergeAndFilterToolsFunction · 0.85
toolMatchesNameFunction · 0.85
getInitJsonSchemaFunction · 0.85

Tested by

no test coverage detected