GitHub Tools
Getting Started
Call GitHub from your first AI SDK request in under five minutes, then level up to agents, eve, and durable workflows.

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

Use tools directly

The simplest integration: pass all tools to generateText and let the model pick the right GitHub operations:

list-prs.ts
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:

review-only.ts
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:

triage-agent.ts
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.',
})
Start with 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 buildingGo to
A standalone agent, fast — 3 files, durable approvaleve
Scripts, chat backends, or an existing AI SDK appAI SDK
Production agents that must survive restarts and timeoutsVercel Workflow
A GitHub, Slack, or Discord botChat SDK

External references