Skip to main content
GitHubTool provides methods to interact with GitHub repositories through the GitHub API using PyGithub.

Installation

Install the GitHub dependency:

Constructor

access_token
str
required
GitHub personal access token or OAuth token for authentication
api_key
str
Optional API key for MCP server usage

Methods

get_issue

Get details of a GitHub issue.
repo_name
str
required
Repository name in format owner/repo
issue_number
int
required
Issue number
Returns: String with issue title, body, and state

create_issue

Create a new issue in a repository.
repo_name
str
required
Repository name in format owner/repo
title
str
required
Issue title
body
str
Issue body/description
Returns: URL of the created issue

create_pr

Create a pull request.
repo_name
str
required
Repository name in format owner/repo
title
str
required
Pull request title
head
str
required
Branch name with changes
base
str
Base branch name (default: “main”)
body
str
Pull request description
Returns: URL of the created pull request

Usage

With Agentor agent

Creating issues

Creating pull requests

Error handling

The tool returns error messages as strings when operations fail:

Source reference

src/agentor/tools/github.py:13
Last modified on May 5, 2026