Guide
Scope with Presets
Expose only the tools your workflow needs using presets.
The SDK ships a large tool catalog so you can build almost any GitHub agent. Presets are how you keep that catalog out of the model's context: each preset exposes only the tools for one workflow. Start with the smallest preset that fits; use maintainer or omit preset when you need the full surface.
Tighten GitHub tool scope with presets
Compose agents around presets
| Shape | When to use |
|---|---|
| One preset | A single job (review PRs, triage issues, cut releases) |
| Array of presets | One agent that spans a few related domains |
| Manager + sub-agents | Several distinct roles — each specialist mounts one preset (example) |
maintainer / omit preset | Prototyping or a genuine need for the full catalog |
Apply a single preset
Use a preset to restrict the tools to a specific capability domain. For example, a code review agent only needs pull request and commit tools:
review-agent.ts
import { createGithubTools } from '@github-tools/sdk'
const tools = createGithubTools({
preset: 'code-review',
})
Focused operator workflows:
security-audit-agent.ts
import { createGithubTools } from '@github-tools/sdk'
const tools = createGithubTools({
preset: 'security-audit',
})
pr-author-agent.ts
import { createGithubTools } from '@github-tools/sdk'
const tools = createGithubTools({
preset: 'pr-author',
})
Combine multiple presets
When a workflow spans multiple domains, pass an array. This agent can both review PRs and manage issues:
triage-and-review.ts
import { createGithubTools } from '@github-tools/sdk'
const tools = createGithubTools({
preset: ['code-review', 'issue-triage'],
})
Pick the right preset
| Preset | Tools included | Use case |
|---|---|---|
repo-explorer | repository metadata, branches, file content, repo tree, code and issue search, discussions, gists, workflows, checks/statuses, releases | knowledge retrieval, repo Q&A |
ci-ops | workflows, runs, jobs, job logs, checks/statuses, commits, repository context | CI monitoring, build ops |
code-review | pull requests, commits, compare diff, file diffs, checks/statuses, updates, review comments, review threads, reviewer requests | PR copilots, change summaries |
issue-triage | issues, issue search, labels, comments, reactions, assignees, close/create/update/reopen | support triage, backlog bots |
security-audit | read-only exploration, code and issue search, PR/CI visibility, checks/statuses, compare diff, plus issue creation to report findings | vulnerability scanning, risk reporting |
release-manager | releases, compare diff, commits, workflow runs, pull requests, update/delete releases | changelog generation, release cutting |
discussion-moderator | discussions list/get/comment, plus light issue context | forum / Q&A bots |
notification-inbox | notifications list/mark-read, plus get issue/PR/repo | inbox triage (needs a Notifications PAT) |
pr-author | branches (create/delete), file edits, create/update pull requests, review threads, compare | open focused PRs and address review feedback without full maintainer |
maintainer | all tool families including branch creation, forking, repo creation, discussions, notifications, gists, and workflows | full operator workflows with approval control |
Pair presets with token scopes
Each preset maps to specific GitHub token permissions:
repo-explorer: read-only token, no write permissions needed (adddiscussions: readfor the discussion tools)code-review: addpull_requests: writeonly if comments or reviewer requests are neededissue-triage: addissues: write(also covers reactions)ci-ops: addactions: writefor triggering, cancelling, and re-running workflowssecurity-audit: read-only token, plusissues: writeto report findingsrelease-manager: addcontents: writefor creating releases,actions: writeif triggering release pipelinesdiscussion-moderator: adddiscussions: writeandissues: writefor cross-linking repliesnotification-inbox: repository read scopes plus a user PAT with the "Notifications" account permission (not available on Connect installation tokens)pr-author: addcontents: writeandpull_requests: writemaintainer: all write scopes, always paired with approval control; notification tools additionally need a PAT with the "Notifications" account permission
Default to the smallest preset that can complete the task. Add more capabilities only after your prompt and approval policy are stable.