Skip to main content
Glama
ice3x2

Google Chat Webhook MCP Server

by ice3x2

Send Google Chat Cards V2

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYes

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[];
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action is to 'Send' a message, implying a write operation, but doesn't cover critical aspects like authentication needs, rate limits, error handling, or what happens upon success (e.g., message delivery confirmation). This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), no annotations, and low complexity, the description is minimally complete but lacks depth. It covers the basic purpose but misses usage context, parameter details, and behavioral traits, making it adequate only in a narrow sense.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'cardsV2' as required but doesn't explain what this array contains or its structure, and it doesn't address the optional 'text' parameter at all. This fails to add meaningful semantics beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send') and target resource ('Cards V2 message to configured Google Chat webhook'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'send_google_chat_markdown' or 'send_google_chat_text' beyond mentioning 'Cards V2' format, which is a format distinction but not a full functional comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling tools. It mentions 'Cards V2' format but doesn't explain scenarios where this is preferred over markdown or text messages, nor does it mention any prerequisites or exclusions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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