fix: allow `tool.execute.after` hook to modify MCP tool output (#3381)

pull/3283/head
Andrew Pashynnyk 2025-10-23 18:38:55 +03:00 committed by GitHub
parent 9ab4414aef
commit 3c7b229d8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -588,10 +588,7 @@ export namespace SessionPrompt {
},
)
const result = await execute(args, opts)
const output = result.content
.filter((x: any) => x.type === "text")
.map((x: any) => x.text)
.join("\n\n")
await Plugin.trigger(
"tool.execute.after",
{
@ -602,6 +599,11 @@ export namespace SessionPrompt {
result,
)
const output = result.content
.filter((x: any) => x.type === "text")
.map((x: any) => x.text)
.join("\n\n")
return {
title: "",
metadata: {},