gitlab_list_project_hooks
Retrieve configured webhooks for a GitLab project to monitor integrations, showing URLs, events, and configuration details.
Instructions
List project webhooks Returns: Configured webhooks Use when: Checking integrations Shows: URLs, events, configuration
Example response: [{ "id": 1, "url": "https://example.com/hook", "push_events": true, "issues_events": true, "merge_requests_events": true, "wiki_page_events": false }]
Related tools:
gitlab_create_project_hook: Add webhook
gitlab_test_project_hook: Test webhook
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Project identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:419-424 (handler)Handler function that executes the tool: gets project_id (auto-detects if missing), calls GitLabClient.get_project_hooks(project_id)def handle_get_project_hooks(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> List[Dict[str, Any]]: """Handle getting project webhooks""" project_id = require_project_id(client, arguments) return client.get_project_hooks(project_id)
- src/mcp_gitlab/tool_handlers.py:1014-1016 (registration)TOOL_HANDLERS dict maps tool name to handler function; dispatched in server.py @server.call_tool()TOOL_LIST_PROJECT_MEMBERS: handle_get_project_members, TOOL_LIST_PROJECT_HOOKS: handle_get_project_hooks, TOOL_LIST_GROUPS: handle_list_groups,
- Tool schema definition (input validation) defining project_id parametername=TOOL_LIST_PROJECT_HOOKS, description=desc.DESC_LIST_PROJECT_HOOKS, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID} } } ),
- src/mcp_gitlab/server.py:734-742 (registration)Tool registration in @server.list_tools() returning the schema for MCP protocolname=TOOL_LIST_PROJECT_HOOKS, description=desc.DESC_LIST_PROJECT_HOOKS, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID} } } ),
- src/mcp_gitlab/constants.py:196-196 (helper)Constant defining the tool name string for consistent usage across filesTOOL_LIST_PROJECT_HOOKS = "gitlab_list_project_hooks"