MCP: standalone report-type job artifacts are listed but cannot be read with get_artifact_file
Split out of #631136 (closed) (side note by @EduardN in the issue description).
Problem
get_job and get_pipeline with include: ["artifacts"] list every artifact a job has, one per file_type. get_artifact_file can only read files inside the job's archive artifact (artifacts.zip).
Report-type artifacts that are uploaded as their own files, outside artifacts.zip, show up in the listing but cannot be read. Example seen in two private projects on GitLab.com: gl-dependency-scanning-report.json (file_type: dependency_scanning). Calling get_artifact_file with that path returns "not found in the artifacts archive" and lists only what is in the zip (here the CycloneDX SBOM).
So an agent is told an artifact exists but has no tool to read it. The listing and the read tool don't agree on what an "artifact" is.
Relevant code:
app/services/mcp/tools/jobs/get_job_service.rb(artifacts_facet): lists alljob.job_artifactsapp/services/mcp/tools/jobs/get_artifact_file_service.rb: reads entries from thearchiveartifact only
Desired Outcome
- An agent can read the content of any artifact that
get_job/get_pipelinelist, including standalone report artifacts such asdependency_scanning. One option: letget_artifact_file(or a new tool) select an artifact byfile_typeor name, not only by a path insideartifacts.zip. - Reading respects the same access checks (
read_job_artifacts), size limits and byte paging asget_artifact_filedoes today. - If an artifact can't be read through MCP, the tool says so clearly (for example: "this is a standalone
dependency_scanningreport, not part ofartifacts.zip"). It should not return a misleading "not found in the artifacts archive".