feat: implement AfterTool tail tool calls (#18486)

This commit is contained in:
Steven Robertson
2026-02-23 19:57:00 -08:00
committed by GitHub
parent ee5eb70070
commit b0ceb74462
23 changed files with 567 additions and 26 deletions

View File

@@ -368,12 +368,14 @@ export class HookSystem {
toolName: string,
toolInput: Record<string, unknown>,
mcpContext?: McpToolContext,
originalRequestName?: string,
): Promise<DefaultHookOutput | undefined> {
try {
const result = await this.hookEventHandler.fireBeforeToolEvent(
toolName,
toolInput,
mcpContext,
originalRequestName,
);
return result.finalOutput;
} catch (error) {
@@ -391,6 +393,7 @@ export class HookSystem {
error: unknown;
},
mcpContext?: McpToolContext,
originalRequestName?: string,
): Promise<DefaultHookOutput | undefined> {
try {
const result = await this.hookEventHandler.fireAfterToolEvent(
@@ -398,6 +401,7 @@ export class HookSystem {
toolInput,
toolResponse as Record<string, unknown>,
mcpContext,
originalRequestName,
);
return result.finalOutput;
} catch (error) {