get_job_logs
Retrieve the trace file for a specific GitLab CI/CD job by providing the project identifier and job ID to access execution logs.
Instructions
Get the log (trace) file of a specific job
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | Job ID | |
| project_id | Yes | Project ID or path |
Implementation Reference
- src/handlers/jobs.ts:31-42 (handler)The core handler function that executes the get_job_logs tool by fetching the job trace (logs) from the GitLab API and returning it as text content.async getJobLogs(args: GetJobLogsParams) { const data = await this.client.get(`/projects/${encodeURIComponent(args.project_id)}/jobs/${args.job_id}/trace`); return { content: [ { type: 'text', text: data, }, ], }; }
- src/tools/jobs.ts:35-52 (schema)MCP tool definition including name, description, and input schema for validating get_job_logs parameters.{ name: 'get_job_logs', description: 'Get the log (trace) file of a specific job', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, job_id: { type: 'number', description: 'Job ID', }, }, required: ['project_id', 'job_id'], }, },
- src/server.ts:321-324 (registration)Registration/dispatch point in the main server switch statement that routes 'get_job_logs' calls to the JobHandlers.getJobLogs method.case "get_job_logs": return await this.jobHandlers.getJobLogs( args as unknown as GetJobLogsParams );
- src/types.ts:394-397 (schema)TypeScript interface defining the input parameters for the getJobLogs handler.export interface GetJobLogsParams { project_id: string; job_id: number; }