Linear
Create, update, and query Linear issues by id, assignee, and priority with LinearTools.
Enable Agno agents with Linear capabilities:
- Issue management
- Triage
- Workflow automation
- Project insights
Prerequisites
- Install dependencies:
uv pip install -U agno openai. - Export your Linear API key:
export LINEAR_API_KEY=your_linear_api_key. - Export your OpenAI API key:
export OPENAI_API_KEY=your_openai_key.
from agno.agent import Agent
from agno.tools.linear import LinearTools
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
name="Linear Tool Agent",
tools=[LinearTools()],
markdown=True,
)
user_id = "69069"
issue_id = "6969"
team_id = "73"
new_title = "updated title for issue"
new_issue_title = "title for new issue"
desc = "issue description"
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
agent.print_response("Get all the details of current user")
agent.print_response(f"Show the issue with the issue id: {issue_id}")
agent.print_response(
f"Create a new issue with the title: {new_issue_title} with description: {desc} and team id: {team_id}"
)
agent.print_response(
f"Update the issue with the issue id: {issue_id} with new title: {new_title}"
)
agent.print_response(f"Show all the issues assigned to user id: {user_id}")
agent.print_response("Show all the high priority issues")Replace the sample user_id, issue_id, and team_id before running. Obtain the current user and team identifiers through get_user_details and get_teams_details, and supply an issue you can access. The active script creates an issue and renames another. update_issue changes the title only; it does not transition workflow state. List methods return one GraphQL response page, so “all issues” may be incomplete.
Run the Example
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno
git checkout d703c34f3abf3c41275d3fb2da6e0518a8881f24
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python cookbook/91_tools/linear_tools.pyFor details, see Linear cookbook.