Skip to content

docs: document get_file_diff tool and file_details in list_chunks#9

Merged
peteretelej merged 3 commits intomainfrom
copilot/update-documentation-for-new-tool
Mar 10, 2026
Merged

docs: document get_file_diff tool and file_details in list_chunks#9
peteretelej merged 3 commits intomainfrom
copilot/update-documentation-for-new-tool

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

  • Read CodeRabbitAI review
  • Fix get_file_diff file_path parameter docs to include empty/whitespace ValueError (matches src/tools.py validation)
  • Verify ChunkInfo schema in Data Models already matches actual models.py (no change needed)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added get_file_diff navigation tool for extracting diffs from specific files.
    • Enhanced list_chunks to display per-file line counts.
  • Documentation

    • Added usage examples for single-file diff workflows.
    • Updated workflow documentation to include new navigation capabilities.

Co-authored-by: peteretelej <2271973+peteretelej@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for newly added tool docs: document get_file_diff tool and file_details in list_chunks Mar 10, 2026
@peteretelej
Copy link
Owner

@coderabbitai

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

@peteretelej Sure! I'll start reviewing the changes in this PR right away.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@peteretelej peteretelej marked this pull request as ready for review March 10, 2026 16:11
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

Documentation is updated to introduce a new get_file_diff MCP navigation tool for retrieving single-file diffs with glob pattern matching. Both README and design documents are enhanced with per-file line counting metadata and corresponding examples.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md, docs/design.md
Add documentation for new get_file_diff tool and per-file line counting metadata (file_line_counts, file_details) to diff data models. Includes usage examples and error handling specifications.

Poem

🐰 A diff tool hops into sight,
Per-file counts make details bright,
Single files now get their own display,
Documentation brightens the way! 🌟

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: documentation updates for the new get_file_diff tool and file_details field in list_chunks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/update-documentation-for-new-tool

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/design.md (1)

106-114: ⚠️ Potential issue | 🟡 Minor

Sync the ChunkInfo schema with the actual dataclass.

src/models.py:18-28 still defines ChunkInfo.content and does not define summary, so this block documents file_details on top of a stale shape. Please update the surrounding fields here to match the implementation, or explicitly label this as the serialized list_chunks response instead of the dataclass.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/design.md` around lines 106 - 114, The docs' ChunkInfo schema is out of
sync with the actual dataclass: the codebase's ChunkInfo (see src/models.py
ChunkInfo) exposes a `content` field instead of `summary`, and the docs add
`file_details` which isn't present on the dataclass; update this docs block to
match the real dataclass fields (replace `summary` with `content`, remove or
adjust `file_details`, and include `parent_file`/`sub_chunk_index` as defined in
src/models.py) or explicitly state that this table describes the serialized
`list_chunks` response (not the dataclass) so readers know which shape is
documented.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/design.md`:
- Around line 79-83: Update the docs/design.md Parameters section for
`file_path` to state that the parameter must be a non-empty, non-whitespace
string and that a ValueError is raised if `file_path` is empty or contains only
whitespace in addition to the already-documented zero-or-multi-match cases;
reference the `file_path` parameter and the ValueError behavior so the public
contract matches the implementation (see the validation implemented around
src/tools.py lines that check/raise on empty or whitespace-only `file_path`).

---

Outside diff comments:
In `@docs/design.md`:
- Around line 106-114: The docs' ChunkInfo schema is out of sync with the actual
dataclass: the codebase's ChunkInfo (see src/models.py ChunkInfo) exposes a
`content` field instead of `summary`, and the docs add `file_details` which
isn't present on the dataclass; update this docs block to match the real
dataclass fields (replace `summary` with `content`, remove or adjust
`file_details`, and include `parent_file`/`sub_chunk_index` as defined in
src/models.py) or explicitly state that this table describes the serialized
`list_chunks` response (not the dataclass) so readers know which shape is
documented.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6fe2d3d5-4fad-4abb-9c26-08a5ced76539

📥 Commits

Reviewing files that changed from the base of the PR and between aa37a40 and 81049c9.

📒 Files selected for processing (2)
  • README.md
  • docs/design.md

docs/design.md Outdated
Comment on lines +79 to +83
**Parameters:**
- `file_path` – Exact path or glob pattern that matches exactly one file in the diff

**Returns:** Formatted string with the `diff --git` header and all hunks for the specified file.
Raises `ValueError` if the pattern matches zero or more than one file.
Copy link

@coderabbitai coderabbitai bot Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Document the non-empty file_path requirement.

src/tools.py:198-206 raises ValueError when file_path is empty or whitespace-only, but this section only mentions the zero-match and multi-match cases. Please add that constraint here so the public contract matches the implementation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/design.md` around lines 79 - 83, Update the docs/design.md Parameters
section for `file_path` to state that the parameter must be a non-empty,
non-whitespace string and that a ValueError is raised if `file_path` is empty or
contains only whitespace in addition to the already-documented
zero-or-multi-match cases; reference the `file_path` parameter and the
ValueError behavior so the public contract matches the implementation (see the
validation implemented around src/tools.py lines that check/raise on empty or
whitespace-only `file_path`).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Co-authored-by: peteretelej <2271973+peteretelej@users.noreply.github.com>
@peteretelej peteretelej merged commit c8384d4 into main Mar 10, 2026
4 checks passed
@peteretelej peteretelej deleted the copilot/update-documentation-for-new-tool branch March 10, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants