Quick Start
First AI SDK call with GitHub tools
New server route with GitHub tools
Install everything at once
If you haven't completed Installation yet:
pnpm add @github-tools/sdk ai zod
npm install @github-tools/sdk ai zod
yarn add @github-tools/sdk ai zod
bun add @github-tools/sdk ai zod
Use tools directly
The simplest integration: pass all tools to generateText and let the model pick the right GitHub operations:
import { createGithubTools } from '@github-tools/sdk'
import { generateText } from 'ai'
const { text } = await generateText({
model: 'anthropic/claude-sonnet-4.6',
tools: createGithubTools(),
prompt: 'List open pull requests on vercel/ai and summarize each one.',
})
console.log(text)
The SDK reads GITHUB_TOKEN from your environment automatically. This gives the model access to all 42 tools — see the Tools Catalog for what each one does.
Narrow tools with a preset
When you want to limit which GitHub operations are available, use a preset. This gives the model only pull request and commit tools:
import { createGithubTools } from '@github-tools/sdk'
import { streamText } from 'ai'
const result = streamText({
model: 'anthropic/claude-sonnet-4.6',
tools: createGithubTools({ preset: 'code-review' }),
prompt: 'Review the latest PR on vercel-labs/github-tools for security issues.',
})
for await (const chunk of result.textStream) {
process.stdout.write(chunk)
}
Learn how each preset maps to tools in Scope with Presets.
Wrap tools in a reusable agent
When you need the same configuration across multiple calls, use createGithubAgent to get a persistent agent:
import { createGithubAgent } from '@github-tools/sdk'
const triager = createGithubAgent({
model: 'anthropic/claude-sonnet-4.6',
preset: 'issue-triage',
system: 'You classify issues as bug, feature, or question. Always post a comment with the classification.',
})
createGithubTools() to learn the tools. Add a preset when you want focus. Move to createGithubAgent() when you need reusable behavior.Level up: pick a framework
The same tools plug into every major agent runtime. Where to go next depends on what you're building:
| You're building | Go to |
|---|---|
| A standalone agent, fast — 3 files, durable approval | eve |
| Scripts, chat backends, or an existing AI SDK app | AI SDK |
| Production agents that must survive restarts and timeouts | Vercel Workflow |
| A GitHub, Slack, or Discord bot | Chat SDK |