Skip to main content
Glama
Alosies
by Alosies

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
NameRequiredDescriptionDefault
job_idYesJob ID
project_idYesProject ID or path

Implementation Reference

  • 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, }, ], }; }
  • 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 );
  • TypeScript interface defining the input parameters for the getJobLogs handler.
    export interface GetJobLogsParams { project_id: string; job_id: number; }

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/Alosies/gitlab-mcp-server'

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