( toolName: string, startedAt: number, outcome: 'completed' | 'infra_error', )
| 234 | type ImportedToolModule = Awaited<ReturnType<typeof importToolModule>>; |
| 235 | |
| 236 | function recordMcpInvocation( |
| 237 | toolName: string, |
| 238 | startedAt: number, |
| 239 | outcome: 'completed' | 'infra_error', |
| 240 | ): void { |
| 241 | recordToolInvocationMetric({ |
| 242 | toolName, |
| 243 | runtime: 'mcp', |
| 244 | transport: 'direct', |
| 245 | outcome, |
| 246 | durationMs: Date.now() - startedAt, |
| 247 | }); |
| 248 | } |
| 249 | |
| 250 | async function invokeRegisteredTool( |
| 251 | toolName: string, |
no test coverage detected