Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 08:30 UTC
fix(examples): check resultType before reading a proxy response
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mukund committed
Oct 20, 2026 at 10:20 UTC
75192490b1134488b1740d9cd16f0e17c7e5e65f
1 file changed
+2
ts/examples/tool-router/src/custom-tools.ts
+2
@@ -60,6 +60,8 @@ const createDraft = experimental_createTool("CREATE_DRAFT", {
60
body: { message: { raw } },
61
});
62
63
+ // A session hook can block the request; it then has no HTTP response.
64
+ if (res.resultType === "blocked") throw new Error(res.message);
65
if (res.status !== 200) throw new Error(`Gmail API error ${res.status}`);
66
const data = res.data as { id: string; message: { id: string } };
67
return { draft_id: data.id, message_id: data.message.id, to: input.to, subject: input.subject };