Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(mcp): make the Adding a Tool example compile

Yudhi Armyndharis773fdfc3ab2e
diff --git a/docs/24-mcp-integration.md b/docs/24-mcp-integration.md
index 80258081b..35ce8207a 100644
--- a/docs/24-mcp-integration.md
+++ b/docs/24-mcp-integration.md
@@ -269,14 +269,15 @@ tier, and a `handler` that calls a service. To add one, append to the relevant t
`src/core/agent-tools/tools/<domain>.tools.ts`:
```ts
-{
+defineTool({
name: 'SessionFindOne',
description: 'Get one session by its UUID, including connection status.',
tier: 'read',
sessionScoped: true,
inputSchema: z.object({ sessionId: z.string().min(1).describe('Session UUID') }),
- handler: (input, _apiKey) => session.findOne(input.sessionId).then(SessionResponseDto.fromEntity),
-}
+ handler: input =>
+ session.findOne(input.sessionId).then(s => SessionResponseDto.fromEntity(s, session.engineLoaded(s))),
+}),
```
Guidelines: