whatsapp-mcp / tools/_registry / ToolDefinition
Interface: ToolDefinition<Schema>
Defined in: src/tools/_registry.ts:53
A single MCP tool. Tools are pure: side effects (DB writes, Meta API calls,
Inngest dispatch) happen through helpers from src/db/, src/wa/, and
src/inngest/ — not directly inside this file.
Type Parameters
Schema
Schema extends ZodTypeAny = ZodTypeAny
zod schema for the tool’s input payload.
Properties
description
readonly description: string;Defined in: src/tools/_registry.ts:57
One-sentence summary surfaced via tools/list.
inputSchema
readonly inputSchema: Schema;Defined in: src/tools/_registry.ts:64
zod schema for the tool’s input object.
name
readonly name: string;Defined in: src/tools/_registry.ts:55
Lower-snake-case identifier exposed to MCP clients (e.g. send_message).
scope
readonly scope: string | null;Defined in: src/tools/_registry.ts:62
Scope string the API key must carry to invoke this tool. Use null only
for owner-and-anonymous tools like ping. Phase 4 will enforce.
Methods
handler()
handler(input, context): Promise<unknown>;Defined in: src/tools/_registry.ts:70
Tool handler. Receives the validated input and the request context.
Throw an Error to surface a tool-level error; throw a McpError to
surface a protocol-level error (e.g. invalid params).
Parameters
input
output<Schema>
context
Returns
Promise<unknown>