Skip to main content
Glama

delete-webhook-subscription

Delete the active webhook subscription to stop all automatic notifications.

Instructions

Delete the current webhook subscription for this account. This will stop all webhook notifications.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The delete-webhook-subscription tool handler: schema definition, server.tool registration with empty schema, async handler that calls hevyClient.deleteWebhookSubscription(), and wraps with error handling. Returns JSON response on success or empty response on failure.
    // Delete webhook subscription
    const deleteWebhookSubscriptionSchema = {} as const;
    type DeleteWebhookSubscriptionParams = InferToolParams<
    	typeof deleteWebhookSubscriptionSchema
    >;
    
    server.tool(
    	"delete-webhook-subscription",
    	"Delete the current webhook subscription for this account. This will stop all webhook notifications.",
    	deleteWebhookSubscriptionSchema,
    	withErrorHandling(async (_args: DeleteWebhookSubscriptionParams) => {
    		if (!hevyClient) {
    			throw new Error(
    				"API client not initialized. Please provide HEVY_API_KEY.",
    			);
    		}
    		if (!hevyClient.deleteWebhookSubscription) {
    			throw new Error(
    				"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec.",
    			);
    		}
    		const data = await hevyClient.deleteWebhookSubscription();
    		if (!data) {
    			return createEmptyResponse(
    				"Failed to delete webhook subscription - no subscription may exist or there was a server error",
    			);
    		}
    		return createJsonResponse(data);
    	}, "delete-webhook-subscription"),
    );
  • Empty schema (no input params) for delete-webhook-subscription since it requires no arguments.
    const deleteWebhookSubscriptionSchema = {} as const;
    type DeleteWebhookSubscriptionParams = InferToolParams<
    	typeof deleteWebhookSubscriptionSchema
    >;
  • Registration of 'delete-webhook-subscription' tool via server.tool() with name, description, schema, and handler.
    server.tool(
    	"delete-webhook-subscription",
    	"Delete the current webhook subscription for this account. This will stop all webhook notifications.",
    	deleteWebhookSubscriptionSchema,
    	withErrorHandling(async (_args: DeleteWebhookSubscriptionParams) => {
    		if (!hevyClient) {
    			throw new Error(
    				"API client not initialized. Please provide HEVY_API_KEY.",
    			);
    		}
    		if (!hevyClient.deleteWebhookSubscription) {
    			throw new Error(
    				"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec.",
    			);
    		}
    		const data = await hevyClient.deleteWebhookSubscription();
    		if (!data) {
    			return createEmptyResponse(
    				"Failed to delete webhook subscription - no subscription may exist or there was a server error",
    			);
    		}
    		return createJsonResponse(data);
    	}, "delete-webhook-subscription"),
    );
  • src/index.ts:48-80 (registration)
    Import and registration of registerWebhookTools function which registers the delete-webhook-subscription tool.
    import { registerWebhookTools } from "./tools/webhooks.js";
    import { registerWorkoutTools } from "./tools/workouts.js";
    import { assertApiKey, parseConfig } from "./utils/config.js";
    import { createClient } from "./utils/hevyClient.js";
    
    const HEVY_API_BASEURL = "https://api.hevyapp.com";
    
    const serverConfigSchema = z.object({
    	apiKey: z
    		.string()
    		.min(1, "Hevy API key is required")
    		.describe("Your Hevy API key (available in the Hevy app settings)."),
    });
    
    export const configSchema = serverConfigSchema;
    type ServerConfig = z.infer<typeof serverConfigSchema>;
    
    function buildServer(apiKey: string) {
    	const baseServer = new McpServer({
    		name,
    		version,
    	});
    	const server = Sentry.wrapMcpServerWithSentry(baseServer);
    
    	const hevyClient = createClient(apiKey, HEVY_API_BASEURL);
    	console.error("Hevy client initialized with API key");
    
    	registerWorkoutTools(server, hevyClient);
    	registerRoutineTools(server, hevyClient);
    	registerTemplateTools(server, hevyClient);
    	registerFolderTools(server, hevyClient);
    	registerBodyMeasurementTools(server, hevyClient);
    	registerWebhookTools(server, hevyClient);
  • Stub implementation of deleteWebhookSubscription in the Kubb client (currently throws 'not available' error, pending OpenAPI spec regeneration).
    deleteWebhookSubscription: async (): Promise<unknown> => {
    	throw new Error(
    		"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec.",
    	);
    },
Behavior2/5

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

No annotations are provided, and the description only mentions deletion and stopping notifications. It does not disclose idempotency, what happens if no subscription exists, or any side effects. More detail would improve behavioral transparency.

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 extremely concise with two sentences that convey the essential information. No unnecessary words, making it efficient for an AI agent to parse.

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

Completeness4/5

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

For a parameterless tool, the description adequately explains the action and consequence. However, it lacks details on error states or confirmation, but given no output schema, it is reasonably complete.

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

Parameters4/5

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

The input schema has zero parameters, so the description is not required to explain parameters. However, it could mention which account or 'current' subscription is targeted, but the tool's simplicity makes this acceptable.

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

Purpose5/5

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

The description clearly states the action ('delete') and the resource ('webhook subscription'), along with the consequence ('stop all webhook notifications'). It effectively distinguishes itself from sibling tools like create-webhook-subscription and get-webhook-subscription.

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

Usage Guidelines3/5

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

The description implies when to use (when you want to stop webhook notifications) but does not explicitly state when not to use or provide alternatives. The purpose is obvious given the tool's name and siblings.

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/chrisdoc/hevy-mcp'

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