MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / buildAllTools

Function buildAllTools

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

Source from the content-addressed store, hash-verified

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

Callers 2

drainCommandQueueFunction · 0.85
runHeadlessStreamingFunction · 0.85

Calls 5

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

Tested by

no test coverage detected