Skip to main content
Glama

create_webhook_subscription

Creates or replaces a webhook subscription to receive Hevy workout events at a specified HTTPS URL.

Instructions

Create or replace the user's webhook subscription.

  • url: HTTPS endpoint Hevy will POST events to.

  • event_type: e.g. "workout_created". Hevy only accepts one subscription per key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
event_typeNoworkout_created

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function that creates a webhook subscription by POSTing to /webhook-subscription with url and eventType
    @mcp.tool()
    @tool_guard
    async def create_webhook_subscription(url: str, event_type: str = "workout_created") -> dict[str, Any]:
        """Create or replace the user's webhook subscription.
    
        - `url`: HTTPS endpoint Hevy will POST events to.
        - `event_type`: e.g. "workout_created". Hevy only accepts one subscription per key.
        """
        return {"data": await client.post("/webhook-subscription",
                                            json={"url": url, "eventType": event_type})}
  • Input schema via type hints: url (str) and optional event_type (str, default 'workout_created'). Output is dict[str, Any]
    @mcp.tool()
    @tool_guard
    async def create_webhook_subscription(url: str, event_type: str = "workout_created") -> dict[str, Any]:
        """Create or replace the user's webhook subscription.
    
        - `url`: HTTPS endpoint Hevy will POST events to.
        - `event_type`: e.g. "workout_created". Hevy only accepts one subscription per key.
        """
        return {"data": await client.post("/webhook-subscription",
                                            json={"url": url, "eventType": event_type})}
  • The register() function that's called to attach the tool to the MCP server via @mcp.tool() decorator
    def register(mcp, ctx) -> None:
        client = ctx.client
  • webhooks module imported and register() called in register_all() at line 11
    from . import analytics, folders, routines, templates, webhooks, workouts
    
    
    def register_all(mcp, ctx) -> None:
        workouts.register(mcp, ctx)
        routines.register(mcp, ctx)
        folders.register(mcp, ctx)
        templates.register(mcp, ctx)
        webhooks.register(mcp, ctx)
        analytics.register(mcp, ctx)
Behavior4/5

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

No annotations exist, so the description carries full burden. It discloses creation/replacement (destructive if existing), HTTPS requirement, and one-subscription-per-key limit. Missing details like authentication needs or rate limits, but covers key behaviors adequately.

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 short, uses bullet points for clarity, and front-loads the action. No unnecessary text; every sentence serves a purpose.

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?

Given the low complexity (2 params, output schema exists), the description covers creation behavior and constraints. It omits mention of success responses or error conditions, but the output schema likely provides that. Still, a brief note on expected outcomes would be helpful.

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?

Schema description coverage is 0%, so the description must explain parameters. It explicitly describes 'url: HTTPS endpoint' and 'event_type: e.g. workout_created.' It adds value beyond the schema but could specify valid event types or URL format requirements.

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 'Create or replace the user's webhook subscription,' specifying the action (create/replace) and resource (webhook subscription). This distinguishes it from sibling tools like delete_webhook_subscription or 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 Guidelines4/5

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

It provides context with 'Hevy only accepts one subscription per key,' implying replacement behavior. However, it lacks explicit guidance on when to use this over alternatives (e.g., when to get or delete first). The constraint is helpful but not comprehensive.

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

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