MCPcopy Create free account
hub / github.com/anus-dev/ANUS / waitForAnyToolCall

Method waitForAnyToolCall

integration-tests/test-helper.ts:394–413  ·  view source on GitHub ↗
(toolNames: string[], timeout?: number)

Source from the content-addressed store, hash-verified

392 }
393
394 async waitForAnyToolCall(toolNames: string[], timeout?: number) {
395 // Use environment-specific timeout
396 if (!timeout) {
397 timeout = this.getDefaultTimeout();
398 }
399
400 // Wait for telemetry to be ready before polling for tool calls
401 await this.waitForTelemetryReady();
402
403 return this.poll(
404 () => {
405 const toolLogs = this.readToolLogs();
406 return toolNames.some((name) =>
407 toolLogs.some((log) => log.toolRequest.name === name),
408 );
409 },
410 timeout,
411 100,
412 );
413 }
414
415 async poll(
416 predicate: () => boolean,

Callers 1

Calls 4

getDefaultTimeoutMethod · 0.95
waitForTelemetryReadyMethod · 0.95
pollMethod · 0.95
readToolLogsMethod · 0.95

Tested by

no test coverage detected