> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trypopcorn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom tools overview

> Let your agent call your own systems during a conversation, how a tool looks to the agent, and what your API must support.

A custom tool is an HTTP request your agent can make in the middle of a conversation: check a booking in your reservation system, look up a customer's loyalty points, get the status of a repair ticket, or register a warranty claim. Knowledge covers facts you can write down; tools cover facts the agent must fetch live.

## Where to find tools

Tools has no row in the sidebar. Click **Agent**, open an agent and go to its **Actions** tab. The **Tools** panel lists your tools with a switch for each, and its buttons lead to the rest:

* **Manage tools** (shown once you have a tool) opens the **Tools** page with your list.
* **Add tool** starts a new tool.
* **Open marketplace** opens the **Tools showcase**, where tools other Popcorn accounts shared can be added to yours.

> [!TIP]
>
> Anywhere in the app, outside a text field or a dialog, press **g** and then **t** to open the **Tools** page.

## What a tool is made of

| Part | What it does |
| - | - |
| **Name** and **Description** | What the agent reads to decide whether the tool fits the customer's request. The description is the single most important field: *Look up the delivery status of a repair ticket by ticket number* tells the agent exactly when to use it. |
| **Method** and **URL** | Where the request goes: `GET`, `POST`, `PUT` or `DELETE`, and an `https://` address. Parts of the path that change per call, such as a ticket number, are written as `{ticketId}`. |
| **Headers** | Fixed values sent with every call, typically an authorization key. Header values are stored and never shown again after saving; when you reopen the tool, a header with a stored value shows *Saved. Leave blank to keep it.* in its **Value** field. |
| **Query parameters** and **Body parameters** | The values the request needs. Each has a name, a **Type** (**Text**, **Number**, **Yes or no**, **Object** or **List**), a description the agent reads, and a source: ask the customer, take it from the customer's profile, or use a fixed value. Body parameters are only available for methods other than `GET`. |

For the full field-by-field walkthrough, see [Create a custom tool](https://docs.trypopcorn.ai/tools/create-a-tool.md).

## What happens during a conversation

1. The agent reads the tool's description and its parameter descriptions alongside everything else it can do, and decides on each message whether the tool fits.
2. It gathers the parameter values: from what the customer said, from the customer's profile, or from the fixed value you configured. If a required value is missing, it asks the customer.
3. Popcorn sends the request to your URL with the configured method, headers, query string, path values and JSON body.
4. Your API's JSON response is handed back to the agent, which uses it to write the reply in its own words.
5. If the request fails or your API returns an error, the agent receives the error instead of data and replies without the result.

In the Inbox, a reply that used a tool shows **Used** followed by the tool's name under the message. Click **Details** to open **Message source**; **Tool used** names the tool. See [Working with conversations](https://docs.trypopcorn.ai/inbox/working-conversations.md).

## What your API must support

| Requirement | Detail |
| - | - |
| HTTPS | The URL must use `https://`. An `http://` address can be saved but is refused when the agent calls it, and so are addresses with a username and password in them or a `#` fragment. |
| No keys in the URL | Only a few static options may follow a `?`: `version` (or `api-version`, `v`), `format` (`json`, `xml` or `csv`), `locale` (or `lang`), and paging numbers such as `page`, `limit`, `offset`, `per_page` or `page_size`. Anything else, such as `?key=…`, is refused when the agent calls the tool. Put keys in **Headers** and per-call values in **Query parameters**. |
| JSON | Popcorn sends `Content-Type: application/json` and asks for `application/json` back. |
| Reachable from the internet | Popcorn calls your API from its servers, not from the customer's device. Private or internal addresses (such as `localhost`, names ending in `.local` or `.internal`, or a local network IP) are refused. |
| No redirects | Popcorn does not follow redirects, so use the final address. |

## An example

A repair shop wants the agent to answer "where is my repair?" from its ticketing system.

| Field | Value |
| - | - |
| **Name** | Check repair status |
| **Description** | Use when a customer asks about the progress of a repair or service ticket. Returns the current stage and the expected completion date. |
| **Method** | `GET` |
| **URL** | `https://api.example-repairs.com/tickets/{ticketId}` |
| **Headers** | `Authorization` with the value `Bearer …` |
| **Query parameters** | `ticketId` (**Text**, **Required**, marked **In the URL**): *The 6-digit ticket number printed on the receipt.* Source: **Ask the customer**. |

When a customer writes "any news on ticket 482913?", the agent recognises the request from the description, takes `482913` from the message, calls `https://api.example-repairs.com/tickets/482913`, and answers from the JSON that comes back.

## Manage your tools

The **Tools** page lists one row per tool with its image (or initial), name and description. The **⋯** menu on a row offers **Edit** and **Delete**, and a **Showcase** column with an **In showcase** badge appears once you have shared a tool. The back link at the top reads **Agents**. The list shows tools that belong to the workspace; which agents use them is managed from each agent's page, not here.

## Tools and agents

A tool in the **Tools** list belongs to your workspace. To let an agent use it, switch it on in the **Tools** panel on the agent's **Actions** tab and publish the agent; Popcorn then gives that agent its own copy of the tool, header values included. The tool does not need to be shared. Two consequences follow:

* To delete a tool, first switch it off in every agent that uses it and save those agents. Otherwise **Couldn't delete** followed by the tool name appears with the line "If an agent uses this tool, turn it off in that agent's Tools tab first." (that is the **Tools** panel on the **Actions** tab).
* Editing a tool needs no disconnecting: the copies your agents hold are updated with it. A new URL, method or header value applies to the agents' next calls. A new name, description or parameter set is part of each agent's published version, so click **Save and review** and **Publish changes** on the agent for those to reach customers.

## The showcase

The **Tools showcase** lists tools other Popcorn accounts have shared. You can add one to your workspace with **Add to my tools** and then fill in your own header values. Sharing your own tool has strict rules: it must call a reviewed public API host and carry no keys or fixed values. See [Tools showcase](https://docs.trypopcorn.ai/tools/marketplace.md).

## Next steps

> [card] [Create a custom tool](https://docs.trypopcorn.ai/tools/create-a-tool.md)
>
> New tool, the docs-based starter, parameters, and connecting to an agent.

> [card] [Tools showcase](https://docs.trypopcorn.ai/tools/marketplace.md)
>
> Add a shared tool, or share one that meets the rules.

> [card] [Agent capabilities](https://docs.trypopcorn.ai/agents/capabilities.md)
>
> The built-in abilities you turn on on the agent's tabs.

> [card] [Knowledge](https://docs.trypopcorn.ai/knowledge/overview.md)
>
> For facts you can write down instead of fetching.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.