feat: Add tools to get and search pull requests #69
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The agent currently has tools to create PRs but lacks the ability to read existing PRs or search/filter PRs. This limits its ability to:
Implementation Plan
1. Forgejo API Endpoints (
src/forgejo/index.ts)Add the following functions:
2. Schema Updates (
src/schemas.ts)Add parameter schemas for the list/search operations:
3. New Tools (
src/tools.ts)Add two new tools:
list-pull-requests— List PRs with filters:search-pull-requests— Search PRs by keyword:4. Register Tools (
src/main.ts)Add to
customToolsarray:5. Forgejo API Reference
/repos/{owner}/{repo}/pullsstate,sort,direction,limit,head,base)/repos/{owner}/{repo}/pulls/search?q={query}See: https://forgejo.gitea.io/api/latest/#tag/pull/operation/reposGetPullRequests
Example Agent Workflows
Scenario 1: Check related PRs during review
Scenario 2: Find PRs targeting a specific branch
Scenario 3: PR triage dashboard
Scenario 4: Cross-reference in issue response
Files to Modify
src/schemas.tsprStateSchema,prSortSchema,prDirectionSchema,listPullRequestsParamsSchema,searchPullRequestsParamsSchemasrc/forgejo/index.tslistPullRequests(),searchPullRequests()functionssrc/tools.tslistPullRequestsTool,searchPullRequestsToolexportssrc/main.tscustomToolsarrayPriority: Medium
Impact: High — enables PR discovery, conflict detection, and cross-referencing across all event types. Pairs well with the issue search tools (#68).