Skip to main content
Glama

add_webhook

Subscribe to Codemagic build events by adding a webhook with URL and event list to your application.

Instructions

Add a webhook to a Codemagic application.

Args: app_id: The Codemagic application ID. url: The URL to send webhook payloads to. events: List of events to subscribe to (e.g. ["build.finished", "build.started"]).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
urlYes
eventsYes

Implementation Reference

  • The MCP tool handler that defines and registers the 'add_webhook' tool via the @mcp.tool() decorator. It accepts app_id, url, and events parameters, creates a CodemagicClient, and delegates to client.add_webhook().
    @mcp.tool()
    async def add_webhook(app_id: str, url: str, events: list[str]) -> Any:
        """Add a webhook to a Codemagic application.
    
        Args:
            app_id: The Codemagic application ID.
            url: The URL to send webhook payloads to.
            events: List of events to subscribe to (e.g. ["build.finished", "build.started"]).
        """
        async with CodemagicClient() as client:
            return await client.add_webhook(app_id=app_id, url=url, events=events)
  • The CodemagicClient.add_webhook() method that sends a POST request to /apps/{app_id}/webhooks with the url and events payload. This is the API client helper that performs the actual HTTP call.
    async def add_webhook(self, app_id: str, url: str, events: list[str]) -> Any:
        return await self._post(
            f"/apps/{app_id}/webhooks",
            json={"url": url, "events": events},
        )
  • The register_all_tools() function that calls webhooks.register(mcp), which triggers the registration of add_webhook (and other webhook tools) with the MCP server.
    def register_all_tools(mcp: FastMCP) -> None:
        apps.register(mcp)
        builds.register(mcp)
        artifacts.register(mcp)
        caches.register(mcp)
        variables.register(mcp)
        webhooks.register(mcp)
  • The server startup entry point that calls register_all_tools(mcp) to register all tools including add_webhook.
    register_all_tools(mcp)
Behavior2/5

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

The description lacks details about side effects (e.g., duplicate handling), authentication requirements, or any behavioral traits beyond the basic operation. With no annotations, the description does not disclose enough.

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 a clear one-line purpose followed by a structured arg list. No unnecessary words.

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 no annotations or output schema, the description is too sparse. It does not explain return values, error handling, or resource limits for the created webhook.

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 description adds meaningful context to each parameter, such as 'The Codemagic application ID' and an example for 'events', which goes beyond the schema's minimal titles.

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 'Add a webhook' and specifies the resource 'Codemagic application', which directly distinguishes it from sibling tools like delete_webhook and list_webhooks.

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?

No guidance is provided on when to use this tool versus alternatives, prerequisites, or scenarios where it should not be used.

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/AgiMaulana/CodemagicMcp'

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