Files
github--github-mcp-server/pkg/github/__toolsnaps__/get_commit.snap
T
Timur 7e79ae9aa5 feat: replace include_diff with detail enum on get_commit
Replace the get_commit tool's two boolean flags (include_diff,
include_patch) with a single detail enum: none / stats / full_patch.

Why:
- The two-boolean shape had an awkward dependency
  ("include_patch only applies when include_diff is true") and an
  impossible state (include_patch=true, include_diff=false) that was
  silently ignored.
- A single discriminator collapses three meaningful response shapes
  into one orthogonal choice, makes the most expensive option
  ("full_patch") self-describing, and eliminates the "diff vs patch"
  naming confusion.

Behavior:
- Default ("stats") matches the previous default
  (include_diff=true, include_patch=false): per-file metadata with no
  patch text. Existing callers using defaults are unaffected.
- "none" omits Stats and Files entirely (was include_diff=false).
- "full_patch" is the new opt-in level that adds the unified diff to
  each MinimalCommitFile.

Breaking change: callers that previously passed include_diff or
include_patch must switch to detail. Callers using the defaults are
unaffected.

Changes:
- Added Patch field to MinimalCommitFile.
- Added commitDetail type, parseCommitDetail, and migrated
  convertToMinimalCommit to take a commitDetail.
- Updated get_commit schema, list_commits caller (commitDetailNone),
  unit tests, toolsnap, and README.

Co-authored-by: Sam Morrow <sammorrowdrums@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-01 22:26:09 +02:00

51 lines
1.4 KiB
Plaintext

{
"annotations": {
"readOnlyHint": true,
"title": "Get commit details"
},
"description": "Get details for a commit from a GitHub repository",
"inputSchema": {
"properties": {
"detail": {
"default": "stats",
"description": "Level of detail to include for changed files. \"none\" omits stats and files entirely. \"stats\" (default) includes per-file metadata: filename, status, and lines-of-code counts (additions, deletions, changes), with no patch content. \"full_patch\" additionally includes the unified diff content for each file and can be very large.",
"enum": [
"none",
"stats",
"full_patch"
],
"type": "string"
},
"owner": {
"description": "Repository owner",
"type": "string"
},
"page": {
"description": "Page number for pagination (min 1)",
"minimum": 1,
"type": "number"
},
"perPage": {
"description": "Results per page for pagination (min 1, max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"sha": {
"description": "Commit SHA, branch name, or tag name",
"type": "string"
}
},
"required": [
"owner",
"repo",
"sha"
],
"type": "object"
},
"name": "get_commit"
}