Skip to main content
Use this pattern when you want Claude Code, Codex, Cursor, or another MCP-capable agent to call a Clay function for structured GTM data.

1. Install the Clay plugin

The Clay plugin gives agents both MCP capabilities and the Clay CLI.

Clay plugin quickstart

Install the plugin and configure CLAY_API_KEY.

2. Choose a function

Use a Clay-managed function for common jobs like finding emails or enriching companies. Use a custom function when your team already has Clay logic it wants agents to call.

Routines

Compare Clay-managed functions, custom functions, and Workflows.

3. Expose the function

For custom functions:
  1. Open Functions.
  2. Select the function.
  3. Open Details.
  4. Enable MCP if the agent should call it through MCP.
  5. Enable API if you also want API or CLI execution.

4. Let the agent call it

After setup, the agent can discover and run the function from its available routines. Keep the input schema tight and the output predictable. Good functions for agents:
  • Find a person’s work email.
  • Enrich a company by domain.
  • Score an inbound lead.
  • Summarize account research.
  • Route a lead to the right owner or motion.