Skip to main content
Glama
ice3x2

Google Chat Webhook MCP Server

by ice3x2

send_google_chat_cards_v2

Send structured Cards V2 messages to Google Chat webhooks for formatted notifications with headers, lists, tables, and images.

Instructions

Send a Cards V2 message to configured Google Chat webhook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
cardsV2Yes

Implementation Reference

  • src/server.ts:111-120 (registration)
    Registers the 'send_google_chat_cards_v2' tool with the MCP server, including title, description, input and output schemas, and references the handler function.
    server.registerTool( 'send_google_chat_cards_v2', { title: 'Send Google Chat Cards V2', description: 'Send a Cards V2 message to configured Google Chat webhook', inputSchema: ( { text: z.string().optional(), cardsV2: z.array(z.any()) } as unknown ) as any, outputSchema: ( { success: z.boolean() } as unknown ) as any }, sendCardsHandler );
  • The MCP tool handler for 'send_google_chat_cards_v2'. It receives input parameters, calls the sendCardsV2Message helper, handles success/error responses, and formats output for MCP protocol.
    const sendCardsHandler = (async ({ text, cardsV2 }: { text?: string; cardsV2: any[] }) => { try { await sendCardsV2Message({ text, cardsV2 }, 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;
  • Core implementation that performs HTTP POST to Google Chat webhook with Cards V2 payload using axios. Includes input validation, mock mode without webhook, logging, and error handling.
    export async function sendCardsV2Message(params: SendCardsV2Params, webhookUrl?: string) { if (!params || !Array.isArray(params.cardsV2)) { const error = 'Invalid params for sendCardsV2Message'; logger.error('sendCardsV2Message', 'send_failed', { error }); throw new Error(error); } if (!webhookUrl) { logger.warn('sendCardsV2Message', 'send_failed' as any, { message: 'No webhook configured — skipping HTTP send', }); console.log('[sendCardsV2Message] no webhook configured — skipping HTTP send. payload:', params); return { mock: true }; } const payload: any = { cardsV2: params.cardsV2 }; if (params.text) payload.text = params.text; try { console.log(`[sendCardsV2Message] Sending to: ${webhookUrl}`); const res = await axios.post(webhookUrl, payload, { timeout: 5000 }); return res.data; } catch (error: any) { logger.error('sendCardsV2Message', 'send_failed', { error: error.message || String(error), text: params.text, }); throw error; } }
  • TypeScript type definition for the input parameters expected by sendCardsV2Message, matching the tool's input schema.
    export type SendCardsV2Params = { text?: string; cardsV2: any[]; };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ice3x2/google-chat-webhook-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server