Creating Custom Tools
Custom tools let you extend agents beyond the built-in catalog capabilities. Agent Studio supports two types of custom tools: SMTP tools for sending emails and HTTP tools for calling external REST APIs.
SMTP tools
Section titled “SMTP tools”SMTP tools enable agents to send emails via an SMTP server. Common use cases include:
- Sending notification or alert emails
- Distributing reports with chart attachments
- Automated communications triggered by agent flows
Configuration
Section titled “Configuration”SMTP tools require three pieces of configuration:
| Component | Description |
|---|---|
| SMTP config | Server hostname, port, TLS setting, and sender email address |
| Auth config | Credentials for authenticating with the SMTP server |
| Tool metadata | Display name, description, and a unique function name |
Creating an SMTP tool
Section titled “Creating an SMTP tool”-
Open the tool creation form
In Agent Studio, go to Tools and click Add tool. Select the SMTP tab.
-
Fill in the tool details
Field Description Example Name A display name for the tool Email SenderUnique function name A unique identifier for the LLM send_emailDescription Helps the LLM understand when to use this tool Send email notifications to recipientsSMTP Host Your SMTP server hostname smtp.yourprovider.comPort SMTP port (typically 587 for STARTTLS) 587Use STARTTLS Enable TLS encryption trueSender email The “From” address for outgoing emails notifications@yourcompany.comUsername SMTP username (from your email provider) Password SMTP password or API key (from your email provider) -
Save and test
Click Save, then select the tool and click Run tool to verify the configuration with test inputs.
-
Assign the tool to an agent
When creating or editing an agent, add the tool from the agent’s tool configuration panel.
SMTP configuration fields
Section titled “SMTP configuration fields”| Field | Type | Default | Description |
|---|---|---|---|
host | string | required | SMTP server hostname |
port | integer | 587 | SMTP server port (1—65535) |
use_starttls | boolean | true | Whether to use STARTTLS encryption |
sender_email | string | required | The “From” address for outgoing emails |
Common SMTP providers
Section titled “Common SMTP providers”| Provider | Host | Port | Username |
|---|---|---|---|
| SendGrid | smtp.sendgrid.net | 587 | apikey (API key as password) |
| AWS SES | email-smtp.{region}.amazonaws.com | 587 | IAM SMTP credentials |
| Gmail | smtp.gmail.com | 587 | Email address (app password required) |
| Mailgun | smtp.mailgun.org | 587 | postmaster@your-domain.mailgun.org |
Tool inputs at runtime
Section titled “Tool inputs at runtime”When an agent calls the SMTP tool, it provides the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string or list | Yes | Recipient email address(es) |
subject | string | Yes | Email subject line |
body | string | Yes | Email body content (plain text or HTML) |
body_format | string | No | "plain" (default) or "html" |
attachment_asset_ids | list | No | Asset IDs to attach to the email |
cc | string or list | No | CC recipient(s) |
bcc | string or list | No | BCC recipient(s) |
HTTP tools
Section titled “HTTP tools”HTTP tools enable agents to call external HTTPS endpoints. Common use cases include:
- Calling REST APIs (CRM lookups, ticketing systems, etc.)
- Sending webhook notifications (Slack, Teams, etc.)
- Integrating with cloud services (Microsoft Graph, Google APIs, etc.)
Configuration
Section titled “Configuration”HTTP tools require four pieces of configuration:
| Component | Description |
|---|---|
| HTTP config | URL template, HTTP method, and timeout |
| Auth config | Credentials for authenticating with the endpoint |
| Input parameter schema | JSON Schema defining the tool’s input parameters |
| Tool metadata | Display name, description, and a unique function name |
Creating an HTTP tool
Section titled “Creating an HTTP tool”-
Open the tool creation form
In Agent Studio, go to Tools and click Add tool. Select the REST tab.
-
Fill in the tool details
Field Description Example Name A display name for the tool Customer LookupUnique function name A unique identifier for the LLM lookup_customerDescription Helps the LLM understand when to use this tool Look up customer details by IDURL HTTPS URL template (use {param}for path parameters)https://api.example.com/v1/customers/{customer_id}Method HTTP method GETTimeout (seconds) Request timeout (max 60) 30Authentication method How to authenticate with the endpoint See Supported authentication types -
Add input parameter schema
Click Add input parameter schema and define the parameters the tool accepts as a JSON Schema. Path parameters in the URL (e.g.,
{customer_id}) must be included and marked asrequired.{"type": "object","properties": {"customer_id": {"type": "string","description": "Customer ID to look up"}},"required": ["customer_id"]} -
Save and test
Click Save, then select the tool and click Run tool to verify the configuration.
-
Assign the tool to an agent
When creating or editing an agent, add the tool from the agent’s tool configuration panel.
HTTP configuration fields
Section titled “HTTP configuration fields”| Field | Type | Default | Description |
|---|---|---|---|
url | string | required | HTTPS URL template (can include {param} placeholders) |
method | string | required | GET, POST, PUT, PATCH, or DELETE |
timeout_seconds | integer | 30 | Request timeout in seconds (max 60) |
URL templates
Section titled “URL templates”URLs can include path parameters using {param} syntax:
https://api.example.com/users/{user_id}https://api.example.com/v1/{resource_type}/{resource_id}Requirements:
- Must use HTTPS (HTTP is not allowed)
- Cannot use IP addresses (domain names only)
- Cannot point to localhost or private network ranges
- Path parameters must be defined in
input_parameter_schemaand marked asrequired
Parameter routing
Section titled “Parameter routing”Parameters are automatically routed based on the HTTP method:
| Method | Path parameters | Remaining parameters |
|---|---|---|
GET, DELETE | Substituted into URL | Sent as query string |
POST, PUT, PATCH | Substituted into URL | Sent as JSON body |
Supported authentication types
Section titled “Supported authentication types”| Auth Type | Use Case | Required Fields |
|---|---|---|
NONE | Public APIs or API key via headers | custom_headers (optional) |
BASIC | Username/password | username, password |
CLIENT_CREDENTIALS | OAuth 2.0 server-to-server | token_url, client_id, client_secret, scopes (optional) |
AUTHORIZATION_CODE | OAuth 2.0 user-delegated | authorization_url, token_url, client_id, client_secret (optional) |
Authentication examples
Section titled “Authentication examples”API key via custom headers
{ "name": "API Key Auth", "auth_type": "NONE", "custom_headers": { "X-API-Key": "your-api-key" }}Basic authentication
{ "name": "Basic Auth", "auth_type": "BASIC", "username": "user", "password": "password"}OAuth 2.0 Client Credentials
{ "name": "OAuth M2M", "auth_type": "CLIENT_CREDENTIALS", "token_url": "https://auth.example.com/oauth/token", "client_id": "your-client-id", "client_secret": "your-client-secret", "scopes": "api.read api.write"}Example: Sending email via Microsoft Graph API
Section titled “Example: Sending email via Microsoft Graph API”Organizations using Microsoft 365 often have SMTP Basic Authentication disabled tenant-wide. In this case, you can use an HTTP tool with the Microsoft Graph Send Mail API to send emails using OAuth 2.0 — no code changes required.
Prerequisites
Section titled “Prerequisites”You need an Azure AD app registration with the Mail.Send application permission. See the Microsoft documentation for setup instructions.
-
Register an app in Microsoft Entra ID (Azure AD)
- Go to the Azure portal > Microsoft Entra ID > App registrations > New registration
- Give it a name (e.g., “Alation Agent Studio Email”)
- Set Supported account types to “Accounts in this organizational directory only”
- No redirect URI is needed
-
Add the Mail.Send permission
- In the app registration, go to API permissions > Add a permission
- Select Microsoft Graph > Application permissions
- Search for and add Mail.Send
- Click Grant admin consent (requires an Azure AD admin)
-
Create a client secret
- Go to Certificates & secrets > New client secret
- Copy the secret value (it is only shown once)
-
Note your tenant and client IDs
- From the app’s Overview page, copy the Application (client) ID and Directory (tenant) ID
Create the HTTP tool
Section titled “Create the HTTP tool”-
In Agent Studio, go to Tools > Add tool > REST tab.
-
Click Edit as JSON at the bottom of the form and paste the following configuration, replacing the placeholder values with your Azure AD app details:
{"name": "Send Email (Microsoft 365)","function_name": "send_email_m365","description": "Send an email using Microsoft Graph API. Use this tool to send emails to recipients with a subject and body.","tool_type": "http","auth_config": {"name": "Microsoft Graph OAuth","auth_type": "CLIENT_CREDENTIALS","token_url": "https://login.microsoftonline.com/<your-tenant-id>/oauth2/v2.0/token","client_id": "<your-client-id>","client_secret": "<your-client-secret>","scopes": "https://graph.microsoft.com/.default"},"http_config": {"url": "https://graph.microsoft.com/v1.0/users/{sender_user_id}/sendMail","method": "POST","timeout_seconds": 30},"input_parameter_schema": {"type": "object","properties": {"sender_user_id": {"type": "string","description": "The email address of the sender, e.g. noreply@yourcompany.com"},"message": {"type": "object","description": "The email message to send","properties": {"subject": {"type": "string","description": "Email subject line"},"body": {"type": "object","description": "Email body","properties": {"contentType": {"type": "string","description": "Body format: Text or HTML"},"content": {"type": "string","description": "The email body content"}},"required": ["contentType", "content"]},"toRecipients": {"type": "array","description": "List of recipients","items": {"type": "object","properties": {"emailAddress": {"type": "object","properties": {"address": {"type": "string","description": "Recipient email address"}},"required": ["address"]}},"required": ["emailAddress"]}}},"required": ["subject", "body", "toRecipients"]}},"required": ["sender_user_id", "message"]}} -
Click Save, then test the tool with sample inputs.
How it works
Section titled “How it works”When an agent calls this tool:
- Agent Studio uses the
CLIENT_CREDENTIALSauth config to automatically fetch an OAuth token fromhttps://login.microsoftonline.com/{tenant}/oauth2/v2.0/token - The token is included as a
Bearertoken in the request to Microsoft Graph - The Graph API sends the email on behalf of the specified sender
- A
202 Acceptedresponse confirms the email was accepted for delivery
Microsoft reference documentation
Section titled “Microsoft reference documentation”- Send mail API reference — Full API specification, request body schema, and examples
- OAuth 2.0 Client Credentials flow — How to obtain tokens for server-to-server calls
- Register an application — Step-by-step Azure AD app registration
- Microsoft Graph permissions reference — Available application permissions
Troubleshooting
Section titled “Troubleshooting”SMTP tools
Section titled “SMTP tools”| Error | Cause | Solution |
|---|---|---|
| Authentication unsuccessful | Wrong credentials or Basic Auth disabled | Verify username/password. For Microsoft 365, use an HTTP tool with Graph API instead |
| Connection refused | Wrong host or port | Verify SMTP server settings with your email provider |
| TLS handshake error | STARTTLS misconfiguration | Verify port supports STARTTLS (typically port 587) |
| Sender not verified | Unverified sender address | Verify the sender email with your provider |
HTTP tools
Section titled “HTTP tools”| Error | Cause | Solution |
|---|---|---|
| URL must use HTTPS | HTTP URL provided | Change the URL scheme to https:// |
| URL cannot use IP addresses | IP address in URL | Use a domain name instead |
| Path parameters not found in schema | Missing schema property | Add the path parameter to input_parameter_schema and mark it as required |
| 401/403 response | Authentication failure | Verify credentials. For OAuth, check that admin consent has been granted |
| Request timed out | Slow endpoint | Increase timeout_seconds (max 60) |
API reference
Section titled “API reference”| Endpoint | Method | Description |
|---|---|---|
/ai/api/v1/config/tool | POST | Create a tool config |
/ai/api/v1/config/tool | GET | List tool configs |
/ai/api/v1/config/tool/{id} | GET | Get a tool config |
/ai/api/v1/config/tool/{id} | PATCH | Update a tool config |
/ai/api/v1/config/tool/{id} | DELETE | Delete a tool config |
For the full API specification, see the API Reference.