| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Add a new get_diff MCP tool backed by the existing git diff API so agents can request structured diffs between refs. Document the tool in MCP docs with parameters aligned to the public API spec. Made-with: Cursor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Sorry, something went wrong.
|
Caution Review failedThe pull request is closed. Configuration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 278f62cc-74d6-4442-bb7a-414d44b0eee3 📥 CommitsReviewing files that changed from the base of the PR and between f401c24 and a7511d7. 📒 Files selected for processing (4)
WalkthroughAdds a new MCP tool get_diff that returns a structured git diff between two refs; includes tool implementation, schema, MCP registration, UI rendering, docs, and changelog entry. (50 words) Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant MCP as MCP Server
participant Tool as get_diff Tool
participant DiffSvc as Diff Service
Client->>MCP: Request get_diff(repo, base, head)
MCP->>Tool: invoke handler with params
Tool->>DiffSvc: getDiff(repo, base, head)
DiffSvc-->>Tool: diff result / error
alt success
Tool-->>MCP: return JSON output + metadata
MCP-->>Client: 200 + diff payload
else service error
Tool-->>MCP: throw Error(response.message)
MCP-->>Client: 5xx error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches 📝 Generate docstrings
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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
Document the new MCP get_diff capability under Unreleased using the repository changelog format and PR link. Made-with: Cursor
There was a problem hiding this comment.
packages/web/src/features/tools/getDiff.ts (1)🤖 Prompt for all review comments with AI agents21-39: Consider size limits for large diffs.
JSON.stringify(response) returns the full diff with no truncation or size cap. For large base..head ranges this could produce very large outputs that exceed MCP client limits or consume excessive tokens. Consider adding a max file/hunk cap or a size guard, similar to the limit parameters on other tools (grep, glob, list_commits).
🤖 Prompt for AI AgentsVerify each finding against the current code and only fix it if needed. In `@packages/web/src/features/tools/getDiff.ts` around lines 21 - 39, The execute handler currently returns the full diff (JSON.stringify(response)) which can be arbitrarily large; update the execute implementation in getDiff.ts (the execute function that calls getDiff and uses isServiceError) to enforce a size/entry cap: either pass a new limit parameter into getDiff (e.g., file/hunk limit) or truncate the response before stringifying (e.g., keep first N files/hunks and set a truncated=true flag), and include metadata that indicates truncation along with repo/base/head; ensure you still throw on isServiceError(response) and preserve the existing metadata merge but replace output with the capped/truncated JSON to avoid oversized payloads.
Verify each finding against the current code and only fix it if needed. Nitpick comments: In `@packages/web/src/features/tools/getDiff.ts`: - Around line 21-39: The execute handler currently returns the full diff (JSON.stringify(response)) which can be arbitrarily large; update the execute implementation in getDiff.ts (the execute function that calls getDiff and uses isServiceError) to enforce a size/entry cap: either pass a new limit parameter into getDiff (e.g., file/hunk limit) or truncate the response before stringifying (e.g., keep first N files/hunks and set a truncated=true flag), and include metadata that indicates truncation along with repo/base/head; ensure you still throw on isServiceError(response) and preserve the existing metadata merge but replace output with the capped/truncated JSON to avoid oversized payloads.
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 53057228-4605-4cf8-8dea-8558c9bc0381
📥 CommitsReviewing files that changed from the base of the PR and between 48ad44d and a23c35a.
📒 Files selected for processing (5)
Sorry, something went wrong.
Register get_diff in the Ask agent toolset and render its output in the details panel so chat workflows can compare refs directly. Made-with: Cursor
| Back | FazBrowse Home | New Git URL |
Fixes SOU-968
Summary
Test plan
Made with Cursor
Summary by CodeRabbit