Skip to main content
Glama

introducing_pr

Read-onlyIdempotent

Identify the pull request that introduced a specific line in a file or a particular commit. Uses git blame and local merge commit data, with optional GitHub API fallback.

Instructions

Read-only. Find the pull request that introduced a line or a commit. First resolves the line to a commit via git blame, then reads the local merge-commit message; if that has no PR reference and GH_TOKEN/GITHUB_TOKEN is set, falls back to the GitHub REST API. Without a token the local path still works; pr is null when nothing can be resolved (e.g. rebase-merged with no PR ref). Provide either commit, or both file and line. May make one outbound GitHub API call (subject to the 5000/h authed rate limit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoPath inside the target git repo. Defaults to the server's current working directory.
fileNoFile path relative to the repo root. Requires `line`.
lineNo1-based line number in `file` to blame back to its introducing commit.
commitNoCommit SHA to look up directly. Use this instead of `file`/`line`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
prNoPR details when resolved, else null.
authorNo
commitNo
sourceNoHow the PR was resolved: `merge-message`, `github-api`, or `not-found`.
commit_dateNo
commit_messageNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint, idempotentHint, destructiveHint), the description details the internal process: git blame, reading merge-commit messages, fallback to GitHub REST API, rate limits, and null result scenarios. This fully discloses behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is comprehensive but somewhat lengthy. It is well-structured with the key point 'Read-only' up front, and each sentence adds value. Could be slightly more concise but still effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (two-step process with fallback) and that an output schema exists, the description covers all necessary behavioral and usage aspects without missing critical details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, baseline is 3. The description adds meaning: explains that `file` and `line` are used together, `commit` is an alternative, and `cwd` defaults. It provides context beyond the schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool finds the PR that introduced a line or commit. It specifies exact inputs (line/commit) and distinguishes from sibling tools like 'co_change' or 'branch_hygiene' by focusing on PR introduction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use (when you need the introducing PR for a line or commit) and mentions token-dependent fallback behavior. However, it does not explicitly state when not to use or compare to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HasanJahidul/git-insight-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server