get_pr_context
Retrieve diff and commits between branches to generate pull request descriptions.
Instructions
Get diff and commits between branches for PR description.
IMPORTANT: After calling this tool, you should:
Check if .devnarrate/pr-templates/ directory exists (use ls or Bash)
If templates exist, list them and ask user which template to use
Read the chosen template file (use Read tool)
If no templates exist, use git_operations.DEFAULT_PR_TEMPLATE
Analyze the diff and commits to fill the template
Args: base_branch: Base branch to compare against (e.g., "main", "dev") head_branch: Head branch (defaults to current branch) cursor: Pagination cursor for large diffs (optional, returned as next_cursor) max_diff_tokens: Maximum tokens per diff chunk (default: 12000, leaves room for commits/files in 25k limit) repo_path: Path to git repository (optional, defaults to Claude's working directory)
Returns: JSON string with commits, files, diff chunk, and pagination info
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | ||
| repo_path | No | ||
| base_branch | Yes | ||
| head_branch | No | ||
| max_diff_tokens | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |