@tooly/linear
v0.0.7
Published
Linear API tools for OpenAI, Anthropic, and AI SDK
Maintainers
Readme
@tooly/linear
Linear API tools for AI applications, compatible with OpenAI function calling, Anthropic tool use, and AI SDK.
Installation
npm install @tooly/linear
# or
yarn add @tooly/linear
# or
pnpm add @tooly/linearSetup
Get your Linear API key from your Linear settings.
Usage
Basic Usage
import { LinearTools } from '@tooly/linear'
const linear = new LinearTools('your-linear-api-key')
// Get available tools for function calling
const tools = linear.getTools()
// Execute a function
const result = await linear.executeFunction('createIssue', {
title: 'New bug report',
description: 'Bug description here',
teamId: 'team-id-here',
})AI SDK
import { createAITools } from '@tooly/linear'
const tools = createAITools('your-linear-api-key')
// Use with generateText
import { generateText } from 'ai'
const result = await generateText({
model: openai('gpt-4.1-nano'),
messages: [{ role: 'user', content: 'Create a new issue' }],
tools,
})OpenAI Function Calling
import { createOpenAIFunctions } from '@tooly/linear'
const { tools, executeFunction } = createOpenAIFunctions('your-linear-api-key')
// Use with OpenAI client
const completion = await openai.chat.completions.create({
model: 'gpt-4.1-nano',
messages: [{ role: 'user', content: 'List my assigned issues' }],
tools,
})
// Execute function calls
for (const toolCall of completion.choices[0].message.tool_calls || []) {
const result = await executeFunction(toolCall.function.name, JSON.parse(toolCall.function.arguments))
}Anthropic Tool Use
import { createAnthropicTools } from '@tooly/linear'
const { tools, executeFunction } = createAnthropicTools('your-linear-api-key')
// Use with Anthropic client
const message = await anthropic.messages.create({
model: 'claude-sonnet-4-20250514',
messages: [{ role: 'user', content: 'Create a new project' }],
tools,
})
// Execute tool calls
for (const toolUse of message.content.filter((c) => c.type === 'tool_use')) {
const result = await executeFunction(toolUse.name, toolUse.input)
}Available Tools
createIssue- Create a new issuegetIssue- Get issue details by IDupdateIssue- Update an existing issuesearchIssues- Search for issuescreateProject- Create a new projectgetTeams- Get all teamsgetUser- Get current user details
License
MIT
