Skip to main content
Glama

manage_webhooks

Control Tailscale webhooks to manage event notifications. Perform operations like listing, creating, deleting, or testing webhooks to configure automated alerts and monitoring.

Instructions

Manage Tailscale webhooks for event notifications

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configNoWebhook configuration for create operation
operationYesWebhook operation to perform
webhookIdNoWebhook ID for delete/test operations

Implementation Reference

  • The handler function implementing the logic for managing Tailscale webhooks. Supports operations: list, create, delete, test using the Tailscale API.
    async function manageWebhooks(
      args: z.infer<typeof WebhookSchema>,
      context: ToolContext,
    ): Promise<CallToolResult> {
      try {
        logger.debug("Managing webhooks:", args);
    
        switch (args.operation) {
          case "list": {
            const result = await context.api.listWebhooks();
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            const webhooks = result.data?.webhooks || [];
            if (webhooks.length === 0) {
              return returnToolSuccess("No webhooks configured");
            }
    
            const webhookList = webhooks
              .map((webhook, index: number) => {
                return `**Webhook ${index + 1}**
      - ID: ${webhook.id}
      - URL: ${webhook.endpointUrl}
      - Events: ${webhook.events?.join(", ") || "None"}
      - Description: ${webhook.description || "No description"}
      - Created: ${webhook.createdAt}`;
              })
              .join("\n\n");
    
            return returnToolSuccess(
              `Found ${webhooks.length} webhooks:\n\n${webhookList}`,
            );
          }
    
          case "create": {
            if (!args.config) {
              return returnToolError(
                "Webhook configuration is required for create operation",
              );
            }
    
            const result = await context.api.createWebhook(args.config);
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `Webhook created successfully:
      - ID: ${result.data?.id}
      - URL: ${result.data?.endpointUrl}
      - Events: ${result.data?.events?.join(", ")}`,
            );
          }
    
          case "delete": {
            if (!args.webhookId) {
              return returnToolError("Webhook ID is required for delete operation");
            }
    
            const result = await context.api.deleteWebhook(args.webhookId);
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `Webhook ${args.webhookId} deleted successfully`,
            );
          }
    
          case "test": {
            if (!args.webhookId) {
              return returnToolError("Webhook ID is required for test operation");
            }
    
            const result = await context.api.testWebhook(args.webhookId);
            if (!result.success) {
              return returnToolError(result.error);
            }
    
            return returnToolSuccess(
              `Webhook test successful. Response: ${JSON.stringify(
                result.data,
                null,
                2,
              )}`,
            );
          }
    
          default:
            return returnToolError(
              "Invalid webhook operation. Use: list, create, delete, or test",
            );
        }
      } catch (error) {
        logger.error("Error managing webhooks:", error);
        return returnToolError(error);
      }
    }
  • Zod input schema for the manage_webhooks tool defining parameters for different operations.
    const WebhookSchema = z.object({
      operation: z
        .enum(["list", "create", "delete", "test"])
        .describe("Webhook operation to perform"),
      webhookId: z
        .string()
        .optional()
        .describe("Webhook ID for delete/test operations"),
      config: z
        .object({
          endpointUrl: z.string(),
          description: z.string().optional(),
          events: z.array(z.string()),
          secret: z.string().optional(),
        })
        .optional()
        .describe("Webhook configuration for create operation"),
    });
  • Tool registration in the adminTools module, specifying name, description, input schema, and handler function.
    {
      name: "manage_webhooks",
      description: "Manage Tailscale webhooks for event notifications",
      inputSchema: WebhookSchema,
      handler: manageWebhooks,
    },
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. 'Manage' implies CRUD operations, but the description doesn't specify what 'manage' entails, what permissions are required, whether operations are destructive, or what the response format looks like. For a multi-operation tool with no annotation coverage, this is insufficient.

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 with zero wasted words. It's appropriately sized and front-loaded with the essential information about what the tool does.

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?

For a multi-operation tool (list/create/delete/test) with no annotations and no output schema, the description is incomplete. It doesn't explain the different operations, their effects, or what results to expect. The context signals show this is a complex tool with nested objects and multiple operations that needs more comprehensive documentation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting for parameter documentation.

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 verb ('manage') and resource ('Tailscale webhooks for event notifications'), providing a specific purpose. However, it doesn't differentiate this tool from its many siblings on the server, which all appear to be Tailscale management tools with similar naming patterns.

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. With 17 sibling tools on the server including other 'manage_' tools, there's no indication of when webhook management is appropriate versus other Tailscale management operations.

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/HexSleeves/tailscale-mcp'

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