---
title: Enhancing Your AI Agent with Custom HTTP Tools
privateVideoUrl: https://stream.mux.com/XSzN6YkL38zdXlW1aLrf02Z68OgUotnG02S92wQrNy3tM.m3u8
isPublicLesson: true
---

Welcome to Lesson 8. In Lesson 7, we connected our AI agent to Linear to get and create tasks using prebuilt tools. But what if n8n doesn’t have a prebuilt tool for what you need? No problem! Today, we’re adding a **custom HTTP tool** to fetch the IDs and names of Linear teams, showing you how to handle custom API calls. By the end, your AI agent will be even more flexible. Let’s get to it!

## Why Use a Custom HTTP Tool?

Our AI agent is already powerful, pulling and creating tasks in Linear with prebuilt tools. But sometimes, you need something specific — like getting a list of all team IDs in Linear — and there’s no prebuilt tool for it. That’s where the **HTTP Request tool** comes in. It lets you make custom API calls to fetch or send data, giving you tons of flexibility.

## Adding the HTTP Request Tool

Let’s add a custom HTTP tool to get all Linear team IDs and names:

1. At the bottom of the **AI Agent**’s node click **Tool**.
2. Search for **HTTP Request** in the tool list. Select it.
3. A settings window opens. Start with the **Tool Description** — this tells the AI what the tool does. Type: `Get list of all available teams and their IDs for Linear task manager.` This clear description helps the AI know when to use this tool.
4. Set up the **HTTP Request**:
    - **Method**: Choose **POST** (Linear’s GraphQL API uses POST for queries).
    - **URL**: Copy and paste Linear’s GraphQL URL: `https://api.linear.app/graphql`.
    - **Authentication**: Select **Predefined Credential Type**, then choose **Linear API**. If you haven’t added your Linear API key yet (from Lesson 4), click “Create New Credential,” paste your key, and save. Your key should auto-connect if it’s already in the Credentials tab.
    - **Body Content Type**: Select **JSON**.
    - **Body**: Paste the JSON query to fetch team IDs and names. Here’s an example:
        
        ```json
        {
          "query": "{ teams { nodes { id name } } }"
        }
        ```
        
        This asks Linear for all teams and their IDs and names.
        
    - **Headers**: n8n automatically adds the right headers, including your API key as a Bearer token, so you don’t need to touch this.
5. Click outside to save. The HTTP Request tool appears on the canvas, connected to the AI Agent.

Let’s rename it for clarity:

- Click the tool node, then click the name at the top.
- Change it to **Get Linear Teams** and save. Now it’s clear what it does.

## Testing the Custom HTTP Tool

Time to test! Open the **Chat Trigger**’s chat window:

- Type something like, “Give me the IDs of my available teams,” and send.

Boom! The canvas shows the HTTP Request tool (Get Linear Teams) running, and the chat lists your Linear teams with their IDs and names, like “Team A, ID: 123” or “Team B, ID: 456.” Check the **Execution Log** (bottom of the screen) to see the flow:

- The AI used Simple Memory for context.
- It read your question and the tool descriptions.
- It chose the Get Linear Teams tool, sent the POST request, and got the team data.
- The results went back to the AI, which formatted the output and saved it to memory.

This is awesome! You just built a custom API call without coding, making your AI agent even more powerful.

## Why This Matters

The HTTP Request tool is a really good tool to know about, because it lets you connect to *any* API, not just n8n’s prebuilt integrations. This flexibility means your AI agent can do almost anything, from fetching data to triggering actions, as long as there’s an API for it.
