Skip to main content
Glama

validate_webhook

Verify webhook connectivity by sending a test message to Discord, Slack, or both services, ensuring proper setup and functionality for notifications.

Instructions

Test webhook connectivity by sending a test message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNo
serviceNo

Implementation Reference

  • Handler function that executes the validate_webhook tool: detects services, sends test messages via Discord/Slack webhooks, collects results, and returns formatted response.
    async (args) => {
      const testMessage = args.message || "notify_me_mcp connectivity test";
      
      try {
        const targetServices = detectService(args.service);
        const config = getConfig();
        const results: ServiceResult[] = [];
    
        for (const service of targetServices) {
          try {
            let result;
            
            if (service === "discord") {
              const payload = buildDiscordPayload({ message: testMessage });
              result = await sendDiscord(config.discordWebhookUrl!, payload);
            } else {
              const payload = buildSlackPayload({ message: testMessage });
              result = await sendSlack(config.slackWebhookUrl!, payload);
            }
    
            results.push({
              service,
              success: result.success,
              httpCode: result.httpCode,
              timestamp: result.timestamp
            });
          } catch (error) {
            results.push({
              service,
              success: false,
              error: error instanceof Error ? error.message : "Unknown error"
            });
          }
        }
    
        const overall = results.some(r => r.success);
        const response: SendResult = {
          success: overall,
          overall,
          results
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2)
            }
          ]
        };
      } catch (error) {
        const errorMsg = error instanceof Error ? error.message : "Unknown error";
        return {
          content: [
            {
              type: "text", 
              text: JSON.stringify({ error: errorMsg }, null, 2)
            }
          ]
        };
      }
    }
  • src/index.ts:52-121 (registration)
    Registration of the validate_webhook tool using McpServer.tool method, including description, input schema, and handler reference.
    server.tool(
      "validate_webhook",
      "Test webhook connectivity by sending a test message",
      {
        service: z.enum(["discord", "slack", "both"]).optional(),
        message: z.string().optional(),
      },
      async (args) => {
        const testMessage = args.message || "notify_me_mcp connectivity test";
        
        try {
          const targetServices = detectService(args.service);
          const config = getConfig();
          const results: ServiceResult[] = [];
    
          for (const service of targetServices) {
            try {
              let result;
              
              if (service === "discord") {
                const payload = buildDiscordPayload({ message: testMessage });
                result = await sendDiscord(config.discordWebhookUrl!, payload);
              } else {
                const payload = buildSlackPayload({ message: testMessage });
                result = await sendSlack(config.slackWebhookUrl!, payload);
              }
    
              results.push({
                service,
                success: result.success,
                httpCode: result.httpCode,
                timestamp: result.timestamp
              });
            } catch (error) {
              results.push({
                service,
                success: false,
                error: error instanceof Error ? error.message : "Unknown error"
              });
            }
          }
    
          const overall = results.some(r => r.success);
          const response: SendResult = {
            success: overall,
            overall,
            results
          };
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(response, null, 2)
              }
            ]
          };
        } catch (error) {
          const errorMsg = error instanceof Error ? error.message : "Unknown error";
          return {
            content: [
              {
                type: "text", 
                text: JSON.stringify({ error: errorMsg }, null, 2)
              }
            ]
          };
        }
      }
    );
  • Zod schema definition for validate_webhook tool inputs, matching the inline schema used in registration.
    export const ValidateWebhookSchema = z.object({
      service: ServiceSchema.optional(),
      message: z.string().optional(),
    });
  • Inline input schema for validate_webhook tool provided during registration.
      service: z.enum(["discord", "slack", "both"]).optional(),
      message: z.string().optional(),
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions sending a test message but lacks critical details: whether this is a read-only or destructive operation (e.g., could it trigger unintended actions?), authentication requirements, rate limits, or what the response looks like (e.g., success/failure indicators). For a tool with potential side effects, this is a significant gap.

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 front-loads the core purpose without unnecessary words. Every part earns its place by specifying the action and resource, making it easy to scan and understand quickly. No redundancy or fluff is present.

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

Completeness2/5

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

Given the tool's complexity (2 parameters, no annotations, no output schema), the description is incomplete. It lacks parameter explanations, behavioral context (e.g., side effects), and output details. While conciseness is high, it sacrifices necessary information for a tool that interacts with external services, leaving the agent under-informed.

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 doesn't explain the two parameters ('message' and 'service') at all—no mention of what the message should contain, the purpose of the service parameter, or the enum values ('discord', 'slack', 'both'). The description adds no value beyond the bare schema, failing to address the coverage gap.

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 tool's purpose with a specific verb ('Test') and resource ('webhook connectivity'), and specifies the action ('by sending a test message'). It distinguishes itself from sibling tools like 'list_services' and 'send_notification' by focusing on validation rather than listing or general notification sending. However, it doesn't explicitly differentiate from potential alternatives for webhook testing within the same domain.

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 alternatives. It doesn't mention prerequisites (e.g., webhook setup), when-not-to-use scenarios (e.g., for production notifications), or explicit alternatives among the sibling tools. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

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

Related 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/thesammykins/notifyme_mcp'

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