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

# Custom functions

> Run your own reusable Clay logic from agents, the CLI, MCP, or the API.

Custom functions are Clay functions your team builds in the Clay UI, then runs from agents, the CLI, MCP, or the API.

## What custom functions are good for

* Team-specific enrichment waterfalls.
* Account scoring and qualification.
* Inbound routing and territory logic.
* CRM hygiene and validation.
* Repeatable research workflows.
* Internal tools that need the same Clay logic your GTM team already trusts.

## Runs and batch runs

The key distinction is where the function is built:

* Build and manage the function in the Clay UI.
* Run and batch-run it programmatically from agents, the CLI, MCP, or API.

<Card title="Encode Clay functions into business systems" href="/recipes/business-systems">
  Call custom functions from backend services, queues, and internal tools.
</Card>

## Expose a function

To call a custom function:

1. Open [Functions](https://app.clay.com/functions).
2. Create or select a function.
3. Open **Details**.
4. Enable the integrations you need, such as **API** or **MCP**.
5. Copy the `t_...` function id.
6. Prefix it with `function:` when you call it from the plugin, CLI, MCP, or API.

Custom function routine ids use the format `function:t_...`.
