Skip to main content
The @guildai-services/guildai~github package provides agents with access to the GitHub REST API through Guild’s GitHub App integration.

Authentication

  • Type: GitHub App
  • Token management: Generated on-demand and refreshed automatically
  • Scoping: Limited to repositories where the Guild GitHub App is installed

Setup

1

Open Credentials

Go to Credentials in Guild.
2

Connect GitHub

Click GitHub and authorize the Guild app on your organization or repository.
3

Select repositories

Choose which repositories to grant access to.

Usage

import { gitHubTools } from "@guildai-services/guildai~github"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that manages GitHub issues",
  tools: { ...gitHubTools },
})

Selecting specific tools

Agents perform better with fewer tools. Use pick() to include only what your agent needs. Tools are named with the github_ prefix — for example, pulls_get becomes github_pulls_get.
import { gitHubTools } from "@guildai-services/guildai~github"
import { llmAgent, pick } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that reviews pull requests",
  tools: {
    ...pick(gitHubTools, [
      "github_pulls_list",
      "github_pulls_get",
      "github_pulls_list_reviews",
      "github_pulls_create_review",
    ]),
  },
})

Trimming responses

GitHub API responses can be large. Use guildServiceTool() with githubSchemasLite to strip unnecessary fields before the LLM sees them.
import {
  githubSchemas as gh,
  githubSchemasLite as ghlite,
  gitHubEndpoints,
} from "@guildai-services/guildai~github"
import { guildServiceTool, llmAgent } from "@guildai/agents-sdk"
import { z } from "zod"

const github_issues_list_for_repo = guildServiceTool("github", {
  description: gitHubEndpoints["issues_list_for_repo"].description,
  inputSchema: gitHubEndpoints["issues_list_for_repo"].parameterSchema,
  outputSchema: z
    .array(gh.IssueSchema)
    .transform((issues) => issues.map((x) => ghlite.IssueSchema.parse(x))),
})

export default llmAgent({
  description: "An agent that triages GitHub issues",
  tools: { github_issues_list_for_repo },
})

API endpoints

OperationMethodPath
gists_listGET/gists
gists_createPOST/gists
gists_list_publicGET/gists/public
gists_getGET/gists/{gist_id}
gists_updatePATCH/gists/{gist_id}
gists_deleteDELETE/gists/{gist_id}
gists_list_commentsGET/gists/{gist_id}/comments
gists_create_commentPOST/gists/{gist_id}/comments
OperationMethodPath
orgs_list_issue_typesGET/orgs/{org}/issue-types
orgs_create_issue_typePOST/orgs/{org}/issue-types
orgs_list_membersGET/orgs/{org}/members
repos_list_for_orgGET/orgs/{org}/repos
repos_create_in_orgPOST/orgs/{org}/repos
OperationMethodPath
repos_getGET/repos/{owner}/{repo}
repos_updatePATCH/repos/{owner}/{repo}
repos_deleteDELETE/repos/{owner}/{repo}
repos_list_activitiesGET/repos/{owner}/{repo}/activity
repos_list_contributorsGET/repos/{owner}/{repo}/contributors
repos_list_languagesGET/repos/{owner}/{repo}/languages
repos_get_readmeGET/repos/{owner}/{repo}/readme
repos_list_tagsGET/repos/{owner}/{repo}/tags
OperationMethodPath
repos_list_branchesGET/repos/{owner}/{repo}/branches
repos_get_branchGET/repos/{owner}/{repo}/branches/{branch}
OperationMethodPath
repos_list_commitsGET/repos/{owner}/{repo}/commits
repos_get_commitGET/repos/{owner}/{repo}/commits/{ref}
repos_compare_commitsGET/repos/{owner}/{repo}/compare/{basehead}
repos_list_commit_comments_for_repoGET/repos/{owner}/{repo}/comments
repos_get_commit_commentGET/repos/{owner}/{repo}/comments/{comment_id}
repos_update_commit_commentPATCH/repos/{owner}/{repo}/comments/{comment_id}
repos_delete_commit_commentDELETE/repos/{owner}/{repo}/comments/{comment_id}
repos_create_commit_commentPOST/repos/{owner}/{repo}/commits/{commit_sha}/comments
repos_get_combined_status_for_refGET/repos/{owner}/{repo}/commits/{ref}/status
repos_list_pull_requests_associated_with_commitGET/repos/{owner}/{repo}/commits/{commit_sha}/pulls
OperationMethodPath
repos_get_contentGET/repos/{owner}/{repo}/contents/{path}
repos_create_or_update_file_contentsPUT/repos/{owner}/{repo}/contents/{path}
repos_delete_fileDELETE/repos/{owner}/{repo}/contents/{path}
OperationMethodPath
issues_list_for_repoGET/repos/{owner}/{repo}/issues
issues_createPOST/repos/{owner}/{repo}/issues
issues_getGET/repos/{owner}/{repo}/issues/{issue_number}
issues_updatePATCH/repos/{owner}/{repo}/issues/{issue_number}
issues_lockPUT/repos/{owner}/{repo}/issues/{issue_number}/lock
issues_unlockDELETE/repos/{owner}/{repo}/issues/{issue_number}/lock
issues_get_parentGET/repos/{owner}/{repo}/issues/{issue_number}/parent
issues_list_sub_issuesGET/repos/{owner}/{repo}/issues/{issue_number}/sub_issues
issues_add_sub_issuePOST/repos/{owner}/{repo}/issues/{issue_number}/sub_issues
issues_remove_sub_issueDELETE/repos/{owner}/{repo}/issues/{issue_number}/sub_issues
issues_list_assigneesGET/repos/{owner}/{repo}/assignees
issues_add_assigneesPOST/repos/{owner}/{repo}/issues/{issue_number}/assignees
issues_remove_assigneesDELETE/repos/{owner}/{repo}/issues/{issue_number}/assignees
issues_list_comments_for_repoGET/repos/{owner}/{repo}/issues/comments
issues_get_commentGET/repos/{owner}/{repo}/issues/comments/{comment_id}
issues_update_commentPATCH/repos/{owner}/{repo}/issues/comments/{comment_id}
issues_delete_commentDELETE/repos/{owner}/{repo}/issues/comments/{comment_id}
issues_list_commentsGET/repos/{owner}/{repo}/issues/{issue_number}/comments
issues_create_commentPOST/repos/{owner}/{repo}/issues/{issue_number}/comments
issues_list_labels_for_repoGET/repos/{owner}/{repo}/labels
issues_create_labelPOST/repos/{owner}/{repo}/labels
issues_get_labelGET/repos/{owner}/{repo}/labels/{name}
issues_update_labelPATCH/repos/{owner}/{repo}/labels/{name}
issues_delete_labelDELETE/repos/{owner}/{repo}/labels/{name}
issues_add_labelsPOST/repos/{owner}/{repo}/issues/{issue_number}/labels
issues_list_dependencies_blocked_byGET/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by
issues_add_blocked_by_dependencyPOST/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by
OperationMethodPath
pulls_listGET/repos/{owner}/{repo}/pulls
pulls_createPOST/repos/{owner}/{repo}/pulls
pulls_getGET/repos/{owner}/{repo}/pulls/{pull_number}
pulls_updatePATCH/repos/{owner}/{repo}/pulls/{pull_number}
pulls_mergePUT/repos/{owner}/{repo}/pulls/{pull_number}/merge
pulls_list_commitsGET/repos/{owner}/{repo}/pulls/{pull_number}/commits
pulls_list_filesGET/repos/{owner}/{repo}/pulls/{pull_number}/files
pulls_list_reviewsGET/repos/{owner}/{repo}/pulls/{pull_number}/reviews
pulls_create_reviewPOST/repos/{owner}/{repo}/pulls/{pull_number}/reviews
pulls_submit_reviewPOST/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events
pulls_list_review_commentsGET/repos/{owner}/{repo}/pulls/{pull_number}/comments
pulls_create_review_commentPOST/repos/{owner}/{repo}/pulls/{pull_number}/comments
pulls_list_requested_reviewersGET/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
pulls_request_reviewersPOST/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
OperationMethodPath
checks_createPOST/repos/{owner}/{repo}/check-runs
checks_getGET/repos/{owner}/{repo}/check-runs/{check_run_id}
checks_updatePATCH/repos/{owner}/{repo}/check-runs/{check_run_id}
checks_list_annotationsGET/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations
checks_list_for_refGET/repos/{owner}/{repo}/commits/{ref}/check-runs
OperationMethodPath
actions_list_repo_workflowsGET/repos/{owner}/{repo}/actions/workflows
actions_get_workflowGET/repos/{owner}/{repo}/actions/workflows/{workflow_id}
actions_list_workflow_runs_for_repoGET/repos/{owner}/{repo}/actions/runs
actions_get_workflow_runGET/repos/{owner}/{repo}/actions/runs/{run_id}
actions_list_workflow_runsGET/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs
actions_list_jobs_for_workflow_runGET/repos/{owner}/{repo}/actions/runs/{run_id}/jobs
actions_list_workflow_run_artifactsGET/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts
actions_download_job_logs_for_workflow_runGET/repos/{owner}/{repo}/actions/jobs/{job_id}/logs
actions_re_run_workflowPOST/repos/{owner}/{repo}/actions/runs/{run_id}/rerun
actions_re_run_workflow_failed_jobsPOST/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs
actions_force_cancel_workflow_runPOST/repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel
OperationMethodPath
repos_list_releasesGET/repos/{owner}/{repo}/releases
repos_create_releasePOST/repos/{owner}/{repo}/releases
repos_get_releaseGET/repos/{owner}/{repo}/releases/{release_id}
repos_update_releasePATCH/repos/{owner}/{repo}/releases/{release_id}
repos_delete_releaseDELETE/repos/{owner}/{repo}/releases/{release_id}
repos_get_latest_releaseGET/repos/{owner}/{repo}/releases/latest
repos_generate_release_notesPOST/repos/{owner}/{repo}/releases/generate-notes
OperationMethodPath
repos_list_deploymentsGET/repos/{owner}/{repo}/deployments
repos_create_deploymentPOST/repos/{owner}/{repo}/deployments
repos_get_deploymentGET/repos/{owner}/{repo}/deployments/{deployment_id}
repos_delete_deploymentDELETE/repos/{owner}/{repo}/deployments/{deployment_id}
repos_create_deployment_statusPOST/repos/{owner}/{repo}/deployments/{deployment_id}/statuses
OperationMethodPath
users_get_by_usernameGET/users/{username}
repos_list_for_userGET/users/{username}/repos

Webhook events

GitHub uses an app-scoped webhook model — a single webhook receives all events and Guild routes them to matching triggers.
EventDescription
issuesIssue opened, closed, edited, assigned, or labeled
issue_commentComment created, edited, or deleted on an issue
pull_requestPR opened, closed, merged, edited, or review requested
pull_request_reviewReview submitted, edited, or dismissed
pull_request_review_commentReview comment created, edited, or deleted
pushCommits pushed to a branch
releaseRelease published, created, edited, or deleted
check_runCheck run created, completed, or rerequested
workflow_jobWorkflow job queued, in progress, or completed
workflow_runWorkflow run requested, completed, or in progress
Guild preprocesses webhook payloads before passing them to agents, removing avatar URLs, permalink URLs, and deeply nested metadata to reduce payload size.

Limitations

  • Access is scoped to repositories where the GitHub App is installed
  • Rate limits follow GitHub’s standard limits (5,000 requests/hour for authenticated apps)