send_google_chat_text
Send text messages to Google Chat via webhooks with automatic Markdown formatting conversion to rich cards, including support for headers, lists, code blocks, tables, and images.
Instructions
Send a text message to configured Google Chat webhook
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Implementation Reference
- src/server.ts:77-86 (handler)Inline handler function for 'send_google_chat_text' tool. Calls sendTextMessage and formats MCP response.const sendTextHandler = (async ({ text }: { text: string }) => { try { await sendTextMessage({ text }, webhook); const out = { success: true }; return { content: [{ type: 'text', text: JSON.stringify(out) }], structuredContent: out }; } catch (err: unknown) { const e = err as Error; return { content: [{ type: 'text', text: `Error: ${e.message}` }], isError: true }; } }) as any;
- src/server.ts:88-97 (registration)Registers the 'send_google_chat_text' tool with MCP server, including title, description, input/output schemas, and handler reference.server.registerTool( 'send_google_chat_text', { title: 'Send Google Chat Text', description: 'Send a text message to configured Google Chat webhook', inputSchema: ( { text: z.string() } as unknown ) as any, outputSchema: ( { success: z.boolean() } as unknown ) as any }, sendTextHandler );
- src/server.ts:93-94 (schema)Zod-based input schema ({ text: string }) and output schema ({ success: boolean }) for the tool.inputSchema: ( { text: z.string() } as unknown ) as any, outputSchema: ( { success: z.boolean() } as unknown ) as any
- src/tools/sendTextMessage.ts:5-18 (helper)Core helper function that sends the text message via HTTP POST to Google Chat webhook using axios.export async function sendTextMessage(params: SendTextParams, webhookUrl?: string) { if (!params || typeof params.text !== 'string') { throw new Error('Invalid params for sendTextMessage'); } if (!webhookUrl) { console.log('[sendTextMessage] no webhook configured — skipping HTTP send. payload:', { text: params.text }); return { mock: true }; } const payload = { text: params.text }; const res = await axios.post(webhookUrl, payload, { timeout: 5000 }); return res.data; }
- src/tools/sendTextMessage.ts:3-3 (schema)TypeScript type definition for input parameters to sendTextMessage.export type SendTextParams = { text: string };