Home/Tools/@tpmjs/tools-github

listPullRequests

@tpmjs/tools-github

List pull requests on a repository with state and head/base filters.

Official
ops
v0.2.0
MIT

Interactive Playground

Test @tpmjs/tools-github (listPullRequests) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-github
pnpm add @tpmjs/tools-github
yarn add @tpmjs/tools-github
bun add @tpmjs/tools-github
deno add npm:@tpmjs/tools-github

2. Import the tool

import { listPullRequests } from '@tpmjs/tools-github';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { listPullRequests } from '@tpmjs/tools-github';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { listPullRequests },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(repo: string, owner: string, base?: string, head?: string, sort?: string, state?: string, per_page?: number) => Promise<unknown>

Tags

agent
base
devops
filters
git
github
head
list
ops
pull
repository
requests
state
tpmjs

Parameters

Available configuration options

Auto-extracted
owner
Required
Type: string

Repository owner.

repo
Required
Type: string

Repository name.

state
Optional
Type: string

Filter by state: open, closed, or all (default: open).

head
Optional
Type: string

Filter by head branch (format: user:ref-name or organization:ref-name).

base
Optional
Type: string

Filter by base branch name.

sort
Optional
Type: string

Sort by: created, updated, popularity, long-running (default: created).

per_page
Optional
Type: number

Results per page (1-100, default: 30).

Schema extracted: 2/27/2026, 4:20:23 AM

README

@tpmjs/tools-github

GitHub API tools for AI agents. Manage repos, issues, pull requests, commits, branches, releases, gists, and Actions workflows.

Installation

npm install @tpmjs/tools-github

Setup

Set your GitHub personal access token:

export GITHUB_TOKEN="ghp_..."

Usage

import { getRepo, listIssues, searchCode } from '@tpmjs/tools-github';

const repo = await getRepo.execute({ owner: 'vercel', repo: 'next.js' });
const issues = await listIssues.execute({ owner: 'vercel', repo: 'next.js', state: 'open', per_page: 5 });
const results = await searchCode.execute({ q: 'useState language:typescript', per_page: 10 });

Tools

ToolDescription
getRepoGet details of a GitHub repository
listReposList repositories for a user or organization
searchRepositoriesSearch GitHub repositories by query
createIssueCreate a new issue on a repository
getIssueGet details of a specific issue
listIssuesList issues with state and label filters
createIssueCommentAdd a comment to an issue or PR
getPullRequestGet details of a specific pull request
listPullRequestsList pull requests with filters
getFileContentGet file or directory contents from a repo
searchCodeSearch for code across GitHub
listBranchesList branches on a repository
getCommitGet details of a specific commit
listCommitsList commits with path and author filters
listReleasesList releases on a repository
getReleaseGet a specific release by tag name
createGistCreate a new GitHub Gist
listGistsList gists for a user
listWorkflowRunsList GitHub Actions workflow runs
getWorkflowRunGet details of a workflow run

License

MIT

Statistics

Downloads/month

200

GitHub Stars

15

Quality Score

89%

Bundle Size

NPM Keywords

tpmjs
github
git
devops
agent

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai