mr_diff_lines
Fetch a merge request's diff as line-numbered hunks with exact file paths and line numbers, safely bounded for large MRs, and optionally filter by files or lines.
Instructions
Fetch a merge request's diff as structured, line-numbered hunks.
Pure data, no LLM. Returns exact file paths, old/new line numbers, and diff content — everything needed to read a change precisely and to compute the diff positions required for inline comments.
Token-safe by construction: on a large MR it returns a bounded page of files and lists the rest under "omitted_files" with "truncated": true (never an oversized payload). Noise files (lockfiles, generated, binary) are listed under "skipped_files", not expanded. For unknown-size MRs, call mr_changed_files first, then batch files_filter here.
Args: url: Full GitLab merge request URL. files_filter: Optional list of file-path fragments to include. Passing this is a TARGETED fetch — noise-skip and the budget are disabled so you get exactly the files you ask for. lines_filter: Optional map of filename-fragment -> target new-file line numbers; returns compact line_mappings instead of full hunks. max_chars: Token-safety budget for the returned diff body (default 80000). Ignored for targeted fetches. skip_noise: Keep lockfiles/generated/binary out of the body (listed under skipped_files). Default True. Ignored when filtering.
Returns: {mr_number, ..., diff_shas, files[...], truncated, omitted_files, skipped_files, stats}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| max_chars | No | ||
| skip_noise | No | ||
| files_filter | No | ||
| lines_filter | No |