GitHub MCP Server

Server URL:

Login URL:

Core Version: 1.1.3

MCP Status: Running ✅

Header Parameters

Notes

All tools that use delete actions require confirmation, this is an experimental feature.

Tools

Branches

Creates a new branch in a specified GitHub repository based on an existing branch.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- new_branch (str): The name of the new branch to create.
- base_branch (Optional[str]): The base branch from which to create the new branch (default is 'main').

Example Requests:
- Creating a New Branch from Main:
create_branch_tool(new_branch="feature-branch", repo="owner/repo")
- Creating a New Branch from a Specific Base Branch:
create_branch_tool(new_branch="feature-branch", base_branch="develop", repo="owner/repo")

Returns:
- JSON string indicating success or error.

Deletes a specified branch in a GitHub repository.

This function first checks if a confirmation token is provided. If not, it generates a token based on the branch and repository parameters.
The user must then confirm the deletion using this token. If the token is provided, the function validates it against the original request parameters before proceeding with the deletion.
The token is valid for a specified duration.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- branch (str): The name of the branch to delete.
- confirmation_token (Optional[str]): An optional token to confirm the deletion. If not provided, a token will be generated based on the branch and repository.

Examples Correct Request:

User: "Delete branch new-features for repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_branch_tool(repo="owner/repo", branch="new-features")`
Assistant Response: "Please confirm deletion of branch new-features"
User: "I confirm"
# Use the confirmation token from the previous request
Assistant Action: `delete_branch_tool(repo="owner/repo", branch="new-features", confirmation_token="XXXYYY")`
Assistant Response: "The branch new-features was deleted successfully."

Examples Incorrect Request:

User: "Delete branch new-features for repository owner/repo"
Assistant Action: `delete_branch_tool(repo="owner/repo", branch="new-features", confirmation_token="made_up_token")`
Server Response: Error: Invalid confirmation token. Please provide a valid token to confirm deletion.
What went wrong: Instead of requesting a token and asking for confirmation, a made up token was sent.

User: "Delete branch new-features for repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_branch_tool(repo="owner/repo", branch="new-features")`
Assistant Action: `delete_branch_tool(repo="owner/repo", branch="new-features", confirmation_token="XXXYYY")`
What went wrong: Confirmation token was used without asking for confirmation.

Returns:
- JSON string indicating success or error.

Commits

Fetch commit details or file diffs from a GitHub repository.

If `files` is provided, returns diffs only for those files. Otherwise, returns general commit info.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- sha (str): The SHA of the commit.
- files (Optional[List[str]]): Optional list of filenames to filter diffs.

Returns:
- JSON response with commit details or file diffs.

Example Requests:
- Fetching details for commit SHA "abc123" in repository "owner/repo":
get_commit_details_tool(repo="owner/repo", sha="abc123")
- Fetching diffs for specific files in commit SHA "abc123" in repository "owner/repo":
get_commit_info_tool(repo="owner/repo", sha="abc123", files=["src/main.py", "README.md"])

Fetch commit history from a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- branch (Optional[str]): The branch to fetch commits from. Default is 'main'.
- path (Optional[str]): Specific file or folder path.
- per_page (Optional[int]): Number of commits to return per page. Default is 15.
- since (Optional[str]): Fetch commits since this timestamp in ISO 8601 format (e.g., '2023-10-10T14:30:00Z').
- until (Optional[str]): Fetch commits until this timestamp in ISO 8601 format (e.g., '2023-10-10T14:30:00Z').

Returns:
- JSON string indicating the commits or error.

Example Requests:
- Fetching commits from the main branch of the repository "owner/repo":
get_commits_tool(repo="owner/repo")
- Fetching commits from the "develop" branch of the repository "anotherUser/repoName":
get_commits_tool(repo="anotherUser/repoName", branch="develop")
- Fetching commits for a specific file in the repository "owner/repo":
get_commits_tool(repo="owner/repo", path="src/main.py")

Retrieve multiple content from multiple files before a given commit SHA.
The repo parameter is required and must be included in the request headers.

Args:
- sha (str): The current commit SHA.
- files (List[str]): List of target file names to retrieve.
- repo (str): The GitHub repository in the format 'owner/repo'.

Returns:
- JSON string indicating files details such as size, name, and URL, and the total files count.

Example Requests:
- Fetching files "file1.txt" and "file2.txt" before commit SHA "abc123" in repository "owner/repo":
get_files_before_commit_tool(sha="abc123", files=["file1.txt", "file2.txt"], repo="owner/repo")
- Fetching files "main.py" and "utils.py" before commit SHA "def456" in repository "anotherUser/repoName":
get_files_before_commit_tool(sha="def456", files=["main.py", "utils.py"], repo="anotherUser/repoName")

Files

Adds a new file to a specified GitHub repository on a specified branch.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- file_path (str): The path where the file will be created, including the filename.
- content (str): The content of the file to be created.
- commit_message (Optional[str]): The commit message for the file creation (default is 'Add new file').
- branch (Optional[str]): The branch where the file will be created (default is 'main').

Returns:
- JSON string indicating success or error.

Deletes specified files in a GitHub repository from a specified branch.

This function first checks if a confirmation token is provided. If not, it generates a token based on the file paths and repository parameters.
The user must then confirm the deletion using this token. If the token is provided, the function validates it against the original request parameters before proceeding with the deletion.
The token is valid for a specified duration.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- file_paths (List[str]): A list of paths of the files to delete, including the filenames.
- confirmation_token (Optional[str]): An optional token to confirm the deletion. If not provided, a token will be generated based on the file paths and repository.
- branch (Optional[str]): The branch from which to delete the files (default is 'main').

Examples Correct Request:

User: "Delete files file1.txt and file2.txt for repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_files_tool(repo="owner/repo", file_paths=["file1.txt", "file2.txt"])`
Assistant Response: "Please confirm deletion of files file1.txt and file2.txt"
User: "I confirm"
# Use the confirmation token from the previous request
Assistant Action: `delete_files_tool(repo="owner/repo", file_paths=["file1.txt", "file2.txt"], confirmation_token="XXXYYY")`
Assistant Response: "The files file1.txt and file2.txt were deleted successfully."

Incorrect Request:

Example 1:
User: "Delete files file1.txt and file2.txt for repository owner/repo"
Assistant Action: `delete_files_tool(repo="owner/repo", file_paths=["file1.txt", "file2.txt"], confirmation_token="made_up_token")`
Server Response: Error: Invalid confirmation token. Please provide a valid token to confirm deletion.
What went wrong: Instead of requesting a token and asking for confirmation, a made-up token was sent.
Example 2:
User: "Delete files file1.txt and file2.txt for repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_files_tool(repo="owner/repo", file_paths=["file1.txt", "file2.txt"])`
Assistant Action: `delete_files_tool(repo="owner/repo", file_paths=["file1.txt", "file2.txt"], confirmation_token="XXXYYY")`
What went wrong: Confirmation token was used without asking for confirmation.

Returns:
- JSON string indicating success or error.

Fetch content for multiple files from a GitHub repository.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- file_paths (List[str]): List of file paths to fetch content for. Ex: ['README.md', 'lib/libname/ComponentName.py']
- branch (Optional[str]): Optional branch name to fetch files from. Defaults to the repository's default branch.

Example Requests:
- Fetching Files from the Default Branch:
get_files_contents_tool(repo="ground-creative/tcval", file_paths=["README.md", "docs/overview.md", "src/main.dart"])
- Fetching Files from a Specific Branch:
get_files_contents_tool(repo="ground-creative/tcval", file_paths=["README.md", "src/utils/helper.py"], branch="branchname")

Returns:
- JSON string containing the file contents or error.

Fetch details for multiple files from a GitHub repository without the content.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- files (List[str]): List of file names to fetch details for. Ex: ['lib/file1.txt', 'assets/file2.txt']
- branch (Optional[str]): Optional branch name to fetch files from. Defaults to the repository's default branch.

Returns:
- JSON string indicating the files details or error.

Example Requests:
- Fetching details for files "file1.txt" and "file2.txt" in repository "owner/repo":
get_files_details_tool(files=["file1.txt", "file2.txt"], repo="owner/repo")
- Fetching details for files "main.py" and "helper.py" in repository "anotherUser/repoName":
get_files_details_tool(files=["main.py", "helper.py"], repo="anotherUser/repoName", branch="develop")

Get a list of file paths from a GitHub repository using the git tree API.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- folders (Optional[List[str]]): Optional list of folder paths to filter by.
- branch (Optional[str]): Optional branch name to fetch files from. Defaults to the repository's default branch.

Returns:
- JSON string containing the list of file paths in the repository or error.

Example Requests:
- Fetching all files from repository "owner/repo":
list_files_tool(repo="owner/repo")
- Fetching files from a specific folder in repository "anotherUser/repoName":
list_files_tool(repo="anotherUser/repoName", folders=["src"])
- Fetching files from a specific branch in repository "owner/repo":
list_files_tool(repo="owner/repo", branch="develop")
- Fetching files from multiple folders in repository "exampleUser/repo":
list_files_tool(repo="exampleUser/repo", folders=["docs", "lib"])

Search for a specific string in the files of a GitHub repository in the main branch.

Args:
- search_string (str): The string to search for in the GitHub repository.
- repo (str): The GitHub repository in the format 'owner/repo'.
- folders (Optional[List[str]]): Optional list of folders to restrict the search.
- sort (Optional[str]): The sort field. Can be 'indexed' or 'stars'.
- order (Optional[str]): The order to sort results. Can be 'asc' or 'desc'.
- page (Optional[int]): The page number of the results to fetch.
- per_page (Optional[int]): The number of results per page.

Returns:
- JSON string indicating the matching files or error.

Example Requests:
- Searching for the term "authentication" in repository "owner/repo":
search_files_tool(search_string="authentication", repo="owner/repo")
- Searching for the term "API" in a specific folder in repository "anotherUser/repoName":
search_files_tool(search_string="API", repo="anotherUser/repoName", folders=["src"])
- Searching for the term "bug" in repository "exampleUser/repo" and sorting by stars:
search_files_tool(search_string="bug", repo="exampleUser/repo", sort="stars", order="desc")
- Searching for the term "feature" in repository "owner/repo" with pagination:
search_files_tool(search_string="feature", repo="owner/repo", page=2, per_page=50)

Update an existing file in a specified GitHub repository on a specified branch.
The repo parameter is required and must be included in the request headers.

Args:
- file_path (str): The path of the file to edit, including the filename.
- new_content (str): The new content to write to the file.
- repo (str): The GitHub repository in the format 'owner/repo'.
- commit_message (Optional[str]): The commit message for the file update (default is 'Update file').
- branch (Optional[str]): The branch where the file will be updated (default is 'main').

Returns:
- JSON string indicating success or error.

Example Requests:
- Updating a file "README.md" in repository "owner/repo":
update_file_tool(file_path="README.md", new_content="New content here", repo="owner/repo")
- Updating a file "src/main.py" in repository "anotherUser/repoName" with a custom commit message:
update_file_tool(file_path="src/main.py", new_content="print('Hello World')", repo="anotherUser/repoName", commit_message="Fix hello world script")
- Updating a file "lib/utils.py" in repository "exampleUser/repo" on a specific branch:
update_file_tool(file_path="lib/utils.py", new_content="def new_function(): pass", repo="exampleUser/repo", branch="develop")

General

Perform a global search on GitHub based on the specified search type and query string.

Args:
- search_type (str): The type of search to perform (e.g., 'repositories', 'issues', 'pulls', 'code', 'commits', 'users').
- query (str): The string to search for.
- page (int): The page number of the results to return.
- per_page (int): The number of results to return per page.

Returns:
- JSON string containing the search results or error.

Example Requests:
- Searching for repositories with the keyword "machine learning":
global_search_tool(search_type="repositories", query="machine learning")
- Searching for issues containing the word "bug":
global_search_tool(search_type="issues", query="bug")
- Searching for code snippets with the term "authentication":
global_search_tool(search_type="code", query="authentication", per_page=10)
- Searching for users with the name "john":
global_search_tool(search_type="users", query="john", page=2)

Issues

Adds a comment to a specified issue in a GitHub repository.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- issue_number (int): The number of the issue to which the comment will be added.
- comment (str): The text of the comment to add.

Example Requests:
- Adding a Comment to an Issue:
create_issue_comment_tool(repo="owner/repo", issue_number=123, comment="This is a comment on the issue.")

Returns:
- JSON string containing the created comment details or error.

Create a new issue within a GitHub repository.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- title (str): The title of the issue to create. This parameter is required.
- body (Optional[str]): The body of the issue to create.
- labels (Optional[list]): Optional list of labels to assign to the issue.

Example Requests:
- Creating a New Issue:
create_issue_tool(repo="owner/repo", title="New Issue Title", body="This is the body of the issue.", labels=["bug", "urgent"])

Returns:
- JSON string containing the created issue details or error.

Deletes a specified comment on an issue in a GitHub repository.

This function first checks if a confirmation token is provided. If not, it generates a token based on the comment ID and repository parameters.
The user must then confirm the deletion using this token. If the token is provided, the function validates it against the original request parameters before proceeding with the deletion.
The token is valid for a specified duration.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- comment_id (int): The ID of the comment to delete.
- confirmation_token (Optional[str]): An optional token to confirm the deletion. If not provided, a token will be generated based on the comment ID and repository.

Examples Correct Request:

User: "Delete comment 123 for repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_issue_comment_tool(repo="owner/repo", comment_id=123)`
Assistant Response: "Please confirm deletion of comment 123"
User: "I confirm"
# Use the confirmation token from the previous request
Assistant Action: `delete_issue_comment_tool(repo="owner/repo", comment_id=123, confirmation_token="XXXYYY")`
Assistant Response: "The comment 123 was deleted successfully."

Examples Incorrect Request:

Example 1:
User: "Delete comment 123 for repository owner/repo"
Assistant Action: `delete_issue_comment_tool(repo="owner/repo", comment_id=123, confirmation_token="made_up_token")`
Server Response: Error: Invalid confirmation token. Please provide a valid token to confirm deletion.
What went wrong: Instead of requesting a token and asking for confirmation, a made-up token was sent.
Example 2:
User: "Delete comment 123 for repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_issue_comment_tool(repo="owner/repo", comment_id=123)`
Assistant Action: `delete_issue_comment_tool(repo="owner/repo", comment_id=123, confirmation_token="XXXYYY")`
What went wrong: Confirmation token was used without asking for confirmation.

Returns:
- JSON string indicating success or error.

Retrieve all messages (details and comments) of a specific issue within a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- issue_number (int): The number of the issue to retrieve. This parameter is required.
- repo (str): The GitHub repository in the format 'owner/repo'.
- page (Optional[int]): The page number of comments to retrieve (default is 1).
- per_page (Optional[int]): The number of comments per page (default is 30).
- sort (Optional[str]): Field to sort comments by (e.g., 'created_at').
- order (Optional[str]): Order of sorting (e.g., 'asc' or 'desc').

Returns:
- JSON string containing the issue details and comments or error.

Example Requests:
- Fetching comments for issue number 123 in repository "owner/repo":
get_issue_comments_tool(issue_number=123, repo="owner/repo")
- Fetching comments for issue number 456 in repository "anotherUser/repoName", page 2:
get_issue_comments_tool(issue_number=456, repo="anotherUser/repoName", page=2)

Retrieve the details of a specific issue within a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- issue_number (int): The number of the issue to retrieve. This parameter is required.
- repo (str): The GitHub repository in the format 'owner/repo'.

Returns:
- JSON string containing the issue details or error.

Example Requests:
- Fetching details for issue number 123 in repository "owner/repo":
get_issue_details_tool(issue_number=123, repo="owner/repo")
- Fetching details for issue number 456 in repository "anotherUser/repoName":
get_issue_details_tool(issue_number=456, repo="anotherUser/repoName")

Fetch issues from a specified GitHub repository, allowing optional filters for state, labels, assignee, and sorting.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- state (Optional[str]): Optional state of the issues (e.g., 'open', 'closed').
- labels (Optional[str]): Optional comma-separated list of labels.
- assignee (Optional[str]): Optional GitHub username for issue assignment.
- milestone (Optional[str]): Optional milestone number or title.
- sort (Optional[str]): Optional sorting criteria (e.g., 'created', 'updated', 'comments').
- order (Optional[str]): Optional order of results (e.g., 'asc', 'desc').
- per_page (Optional[int]): Optional number of issues per page.
- page (Optional[int]): Optional page number.

Returns:
- JSON string containing the list of issues or error.

Example Requests:
- Fetching open issues from repository "owner/repo":
get_issues_tool(repo="owner/repo", state="open")
- Fetching closed issues with label "bug" from repository "anotherUser/repoName":
get_issues_tool(repo="anotherUser/repoName", state="closed", labels="bug")
- Fetching issues assigned to "username" from repository "owner/repo":
get_issues_tool(repo="owner/repo", assignee="username")

Search for issues in a specified GitHub repository, with optional filters for state, labels, assignee, and milestones.
Supports searching comments for a specific term.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- state (Optional[str]): Optional state of the issues (e.g., 'open', 'closed').
- labels (Optional[str]): Optional comma-separated list of labels.
- assignee (Optional[str]): Optional GitHub username for issue assignment.
- milestone (Optional[str]): Optional milestone number or title.
- sort (Optional[str]): Optional sorting criteria (e.g., 'created', 'updated', 'comments').
- order (Optional[str]): Optional order of results (e.g., 'asc', 'desc').
- per_page (Optional[int]): Optional number of issues per page.
- page (Optional[int]): Optional page number.
- search_comments (Optional[bool]): Whether to search comments for the search term.
- query (Optional[str]): The search term to look for in issues and comments.

Returns:
- JSON string containing the list of issues or error.

Example Requests:
- Searching for open issues in repository "owner/repo":
search_issues_tool(repo="owner/repo", state="open")
- Searching for closed issues with the label "bug" in repository "anotherUser/repoName":
search_issues_tool(repo="anotherUser/repoName", state="closed", labels="bug")
- Searching for issues assigned to a specific user in repository "exampleUser/repo":
search_issues_tool(repo="exampleUser/repo", assignee="username")
- Searching for issues with a specific query term in repository "owner/repo":
search_issues_tool(repo="owner/repo", query="feature", search_comments=True)

Updates an existing comment on a specified issue in a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- comment_id (int): The ID of the comment to update.
- new_comment (str): The new text for the comment.
- repo (str): The GitHub repository in the format 'owner/repo'.

Returns:
- JSON string containing the updated comment details or error.

Example Requests:
- Updating comment 123 in repository "owner/repo":
update_issue_comment_tool(comment_id=123, new_comment="This is the updated comment.", repo="owner/repo")
- Updating comment 456 in repository "anotherUser/repoName":
update_issue_comment_tool(comment_id=456, new_comment="Fixing the previous comment.", repo="anotherUser/repoName")

Updates an existing issue in a GitHub repository by modifying its title, body, state (open or closed), and labels.
The repo parameter is required and must be included in the request headers.

Args:
- issue_number (int): The number of the issue to update.
- title (Optional[str]): The new title of the issue.
- body (Optional[str]): The new body of the issue.
- state (Optional[str]): The state of the issue (open or closed).
- labels (Optional[list]): Optional list of labels to assign to the issue.
- repo (str): The GitHub repository in the format 'owner/repo'.

Returns:
- JSON string containing the updated issue details or error.

Example Requests:
- Updating issue number 123 in repository "owner/repo":
update_issue_tool(issue_number=123, title="New Title", body="Updated issue body.", repo="owner/repo")
- Closing issue number 456 in repository "anotherUser/repoName":
update_issue_tool(issue_number=456, state="closed", repo="anotherUser/repoName")
- Adding labels to issue number 789 in repository "exampleUser/repo":
update_issue_tool(issue_number=789, labels=["bug", "urgent"], repo="exampleUser/repo")

Pull Requests

Creates a pull request in a specified GitHub repository by merging changes from one branch to another.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- target_branch (str): The name of the branch to update.
- base_branch (Optional[str]): The base branch from which to merge changes (default is 'main').
- title (Optional[str]): The title of the pull request.
- body (Optional[str]): The body of the pull request.

Example Requests:
- Creating a Pull Request:
create_pull_request_tool(repo="owner/repo", target_branch="feature-branch", base_branch="main", title="New Feature", body="Merging new feature into main branch.")

Returns:
- JSON string indicating success or error.

Fetch detailed information about a specific pull request from a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- pull_number (int): The number of the pull request to retrieve details for.
- repo (str): The GitHub repository in the format 'owner/repo'.

Returns:
- JSON string containing the pull request details or an error message.

Example Requests:
- Fetching details for pull request number 42 in repository "owner/repo":
get_pull_request_details_tool(pull_number=42, repo="owner/repo")
- Fetching details for pull request number 10 in repository "anotherUser/repoName":
get_pull_request_details_tool(pull_number=10, repo="anotherUser/repoName")

Fetch pull requests from a specified GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- state (Optional[str]): Optional state of the pull requests (e.g., 'open', 'closed').
- sort (Optional[str]): Optional sorting criteria (e.g., 'created', 'updated', 'popularity', 'long-running').
- order (Optional[str]): Optional order of results (e.g., 'asc', 'desc').
- per_page (Optional[int]): Optional number of pull requests per page.
- page (Optional[int]): Optional page number.

Returns:
- JSON string containing the list of pull requests or an error message.

Example Requests:
- Fetching open pull requests from repository "owner/repo":
get_pull_requests_tool(repo="owner/repo", state="open")
- Fetching closed pull requests sorted by creation date from repository "anotherUser/repoName":
get_pull_requests_tool(repo="anotherUser/repoName", state="closed", sort="created")
- Fetching pull requests with a specific label from repository "owner/repo":
get_pull_requests_tool(repo="owner/repo", labels="bug")

Merge a specific pull request in a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- pull_number (int): The number of the pull request to merge.
- commit_message (Optional[str]): Optional commit message for the merge.

Returns:
- JSON string containing the response from the GitHub API or an error message.

Example Requests:
- Merging pull request number 42 in repository "owner/repo":
merge_pull_request_tool(pull_number=42, repo="owner/repo")
- Merging pull request number 10 in repository "anotherUser/repoName" with a custom commit message:
merge_pull_request_tool(pull_number=10, repo="anotherUser/repoName", commit_message="Merging feature branch")

Repositories

Create a new repository on GitHub.

Args:
- name (str): The name of the repository to create. This parameter is required.
- description (Optional[str]): A short description of the repository.
- private (Optional[bool]): Whether the repository should be private.
- auto_init (Optional[bool]): Whether to create an initial commit with an empty README.

Example Requests:
- Creating a Public Repository:
create_repository_tool(name="my-new-repo", description="This is my new repository.", private=False, auto_init=True)
- Creating a Private Repository:
create_repository_tool(name="my-private-repo", description="This is a private repository.", private=True, auto_init=False)

Returns:
- JSON string containing the created repository details or error.

Deletes a specified GitHub repository.

This function first checks if a confirmation token is provided. If not, it generates a token based on the repository parameters.
The user must then confirm the deletion using this token. If the token is provided, the function validates it against the original request parameters before proceeding with the deletion.
The token is valid for a specified duration.

Args:
- repo (str): The GitHub repository in the format 'owner/repo' to delete.
- confirmation_token (Optional[str]): An optional token to confirm the deletion. If not provided, a token will be generated based on the repository.

Examples Correct Request:

User: "Delete repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_repository_tool(repo="owner/repo")`
Assistant Response: "Please confirm deletion of repository owner/repo"
User: "I confirm"
# Use the confirmation token from the previous request
Assistant Action: `delete_repository_tool(repo="owner/repo", confirmation_token="XXXYYY")`
Assistant Response: "The repository owner/repo was deleted successfully."

Examples Incorrect Request:

Example 1:
User: "Delete repository owner/repo"
Assistant Action: `delete_repository_tool(repo="owner/repo", confirmation_token="made_up_token")`
Server Response: Error: Invalid confirmation token. Please provide a valid token to confirm deletion.
What went wrong: Instead of requesting a token and asking for confirmation, a made-up token was sent.
Example 2:
User: "Delete repository owner/repo"
# Generate confirmation token to use for next request
Assistant Action: `delete_repository_tool(repo="owner/repo")`
Assistant Action: `delete_repository_tool(repo="owner/repo", confirmation_token="XXXYYY")`
What went wrong: Confirmation token was used without asking for confirmation.

Returns:
- JSON string indicating success or error.

Search for repositories owned by a specific user that include the given query string.
Username parameter is optional, if repo is included in request header, the username will be extracted.

Args:
- query (str): The string to search for in repository names.
- username (str): The GitHub username to fetch repositories for.

Example Request:
- Searching for repositories with the name "project" for user "johnDoe":
find_repositories_by_name_tool(query="project", username="johnDoe")

Returns:
- JSON string containing the search results or error.

Retrieve releases within a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.
- per_page (Optional[int]): Optional number of releases per page.
- page (Optional[int]): Optional page number.
- sort (Optional[str]): Optional sorting criteria (e.g., 'created', 'updated').
- order (Optional[str]): Optional order of results (e.g., 'asc', 'desc').

Returns:
- JSON string containing the list of releases or error.

Example Requests:
- Fetching releases from repository "owner/repo":
get_releases_tool(repo="owner/repo")
- Fetching releases from repository "anotherUser/repoName", page 2:
get_releases_tool(repo="anotherUser/repoName", page=2)
- Fetching releases sorted by creation date from repository "owner/repo":
get_releases_tool(repo="owner/repo", sort="created")

Fetch all repositories for a specific GitHub user, handling pagination.

Args:
- username (str): The GitHub username to fetch repositories for.
- type (Optional[str]): Type of repositories to fetch (default is 'all').
- sort (Optional[str]): Sorting method (default is 'full_name').
- direction (Optional[str]): Sorting direction (default is 'asc').
- page (Optional[int]): Page number to fetch (default is 1).
- per_page (Optional[int]): Number of repositories per page (default is 30, max is 100).

Returns:
- JSON string containing the list of repositories or error.

Example Requests:
- Fetching all repositories for user "octocat":
get_repositories_tool(username="octocat")
- Fetching public repositories for user "octocat":
get_repositories_tool(username="octocat", type="public")
- Fetching repositories sorted by creation date in descending order for user "anotherUser":
get_repositories_tool(username="anotherUser", sort="created", direction="desc")
- Fetching the second page of repositories for user "exampleUser" with 50 repositories per page:
get_repositories_tool(username="exampleUser", page=2, per_page=50)

Fetch details for a single repository from GitHub, including tags, branches, and releases.
The repo parameter is required and must be included in the request headers.

Args:
- repo (str): The GitHub repository in the format 'owner/repo'.

Returns:
- JSON string containing the details of the repository, tags, branches, and releases or error.

Example Requests:
- Fetching details for repository "owner/repo":
get_repository_details_tool(repo="owner/repo")
- Fetching details for repository "anotherUser/repoName":
get_repository_details_tool(repo="anotherUser/repoName")

List either tags or branches in a GitHub repository.
The repo parameter is required and must be included in the request headers.

Args:
- type (str): Specify 'tags' to list tags or 'branches' to list branches.
- repo (str): The GitHub repository in the format 'owner/repo'.
- per_page (Optional[int]): Optional number of items per page.
- page (Optional[int]): Optional page number.

Returns:
- JSON string containing the list of tags or branches or error.

Example Requests:
- Fetching tags for repository "owner/repo":
get_tags_or_branches_tool(type="tags", repo="owner/repo")
- Fetching branches for repository "anotherUser/repoName":
get_tags_or_branches_tool(type="branches", repo="anotherUser/repoName")