list_webhooks
Retrieve configured webhooks for a Bitbucket repository to monitor URL endpoints, event triggers, and status details.
Instructions
List webhooks configured for a repository.
Args:
repo_slug: Repository slug
limit: Maximum number of results (default: 50)
Returns:
List of webhooks with URL, events, and status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| limit | No |
Implementation Reference
- src/server.py:1172-1189 (handler)MCP tool handler: lists repository webhooks via BitbucketClient, formats output using WebhookSummary Pydantic model@mcp.tool() @handle_bitbucket_error @formatted def list_webhooks(repo_slug: str, limit: int = 50) -> dict: """List webhooks configured for a repository. Args: repo_slug: Repository slug limit: Maximum number of results (default: 50) Returns: List of webhooks with URL, events, and status """ client = get_client() webhooks = client.list_webhooks(repo_slug, limit=validate_limit(limit)) return { "webhooks": [WebhookSummary.from_api(w).model_dump() for w in webhooks], }
- src/models.py:457-482 (schema)Pydantic output model WebhookSummary: defines structure and validation for webhook list responses, with from_api factory methodclass WebhookSummary(BaseModel): """Webhook info for list responses.""" uuid: str url: str description: str = "" events: list[str] = [] active: bool = True created: Optional[str] = None @field_validator("created", mode="before") @classmethod def truncate_ts(cls, v: Any) -> Optional[str]: return truncate_timestamp(v) @classmethod def from_api(cls, data: dict) -> "WebhookSummary": return cls( uuid=data.get("uuid", ""), url=data.get("url", ""), description=data.get("description", ""), events=data.get("events", []), active=data.get("active", True), created=data.get("created_at"), )
- src/server.py:1172-1174 (registration)Tool registration via @mcp.tool() decorator on the handler function@mcp.tool() @handle_bitbucket_error @formatted
- src/bitbucket_client.py:1158-1175 (helper)BitbucketClient helper method: performs paginated GET request to Bitbucket API /hooks endpointdef list_webhooks( self, repo_slug: str, limit: int = 50, ) -> list[dict[str, Any]]: """List webhooks for a repository. Args: repo_slug: Repository slug limit: Maximum results to return Returns: List of webhook info dicts """ return self._paginated_list( self._repo_path(repo_slug, "hooks"), limit=limit, )