gitlab_test_webhook
Validate GitLab webhook functionality by testing specific webhooks within designated projects using project and webhook IDs for accurate integration and workflow verification.
Instructions
Test a webhook
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The ID or URL-encoded path of the project | |
| webhook_id | Yes | The ID of the webhook |
Input Schema (JSON Schema)
{
"properties": {
"project_id": {
"description": "The ID or URL-encoded path of the project",
"type": "string"
},
"webhook_id": {
"description": "The ID of the webhook",
"type": "number"
}
},
"required": [
"project_id",
"webhook_id"
],
"type": "object"
}
Implementation Reference
- The main handler function implementing the gitlab_test_webhook tool. It extracts parameters, validates required fields, calls the integrationsManager.testWebhook method with optional trigger_type defaulting to 'push_events', and formats the response.export const testWebhook: ToolHandler = async (params, context) => { const { project_id, webhook_id, trigger_type } = params.arguments || {}; if (!project_id || !webhook_id) { throw new McpError(ErrorCode.InvalidParams, 'project_id and webhook_id are required'); } const data = await context.integrationsManager.testWebhook( project_id as string | number, webhook_id as number, (trigger_type as string) || 'push_events' ); return formatResponse(data); };
- src/utils/tools-data.ts:470-486 (schema)The input schema definition for the gitlab_test_webhook tool, specifying required parameters project_id (string) and webhook_id (number).name: 'gitlab_test_webhook', description: 'Test a webhook', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'The ID or URL-encoded path of the project' }, webhook_id: { type: 'number', description: 'The ID of the webhook' } }, required: ['project_id', 'webhook_id'] } },
- src/utils/tool-registry.ts:47-47 (registration)The registration entry in the toolRegistry that maps the tool name 'gitlab_test_webhook' to the testWebhook handler function from integration-handlers.gitlab_test_webhook: integrationHandlers.testWebhook,