SpamTitan MCP Tools & API Patterns
Overview
The SpamTitan MCP server provides AI tool integration with the SpamTitan email security platform by TitanHQ. It exposes tools covering quarantine queue management, email flow statistics, and sender allowlist/blocklist management. The API uses an API key passed as an HTTP header.
Connection & Authentication
API Key Header Auth
SpamTitan authenticates using an API key passed via HTTP header:
| Header |
Description |
X-SpamTitan-API-Key |
Your SpamTitan API key |
Generate credentials at: SpamTitan Admin Interface > Settings > API
Environment Variables:
export SPAMTITAN_API_KEY="your-api-key"
IMPORTANT: Never hardcode credentials. Always use environment variables.
Available MCP Tools
The server registers nine tools. There is no separate list tool for either
sender list and no separate per-domain statistics tool — both capabilities are
arguments on the tools below.
Quarantine Management
| Tool |
Parameters |
Description |
spamtitan_get_queue |
page, per_page, sender, recipient, subject, reason |
List messages in the quarantine queue. No domain parameter — see the warning below. |
spamtitan_get_message |
message_id (required) |
Get details for a specific quarantined message |
spamtitan_release_message |
message_id (required) |
Release a quarantined message to the recipient |
spamtitan_delete_message |
message_id (required) |
⚠ Permanently delete a quarantined message. Irreversible |
⚠ spamtitan_get_queue cannot be scoped to a customer domain. Its
shipped input schema is exactly page, per_page, sender, recipient,
subject, reason (spamtitan-mcp/src/domains/quarantine.ts:21-53). On a
multi-tenant appliance the listing therefore spans every tenant, and
per-customer filtering has to be done client-side on recipient after the
fetch. This is easy to miss because the sibling spamtitan_get_stats does
take domain. See the quarantine skill and GOVERNANCE.md.
Email Statistics
| Tool |
Parameters |
Description |
spamtitan_get_stats |
period (today|yesterday|last_7_days|last_30_days|last_90_days), domain |
Email flow statistics. Pass domain for a single customer's numbers |
Per-domain statistics are real — they are the domain argument on this tool,
not a separate tool.
List Management
| Tool |
Parameters |
Description |
spamtitan_manage_allowlist |
action (required: add|remove|list), sender, note |
Add, remove, or list sender allowlist entries |
spamtitan_manage_blocklist |
action (required: add|remove|list), sender, note |
⚠ HIGH-IMPACT. Add, remove, or list sender blocklist entries. Changes deliverability for real users |
Listing is action: "list" on the same tool — there is no separate list tool.
action is the only required parameter; sender is required by the handler
for add and remove. Omitting action makes the server elicit it from the
caller, which an unattended agent cannot answer.
Discovery
| Tool |
Parameters |
Description |
spamtitan_status |
— |
Show credentials status and available domains |
spamtitan_navigate |
domain (required) |
Discover tools by domain. This domain is a tool category, not a mail domain |
Pagination
The quarantine queue uses page/per-page pagination:
- Pass
page (1-based) and per_page (default 50, max 200)
- Continue fetching pages until the result count is less than
per_page
Example workflow:
- Call
spamtitan_get_queue with page=1, per_page=100
- If 100 results returned, call again with
page=2
- Repeat until fewer than
per_page results are returned
Rate Limiting
SpamTitan enforces API rate limits per API key:
- HTTP 429 responses indicate rate limit exceeded
- Wait before retrying — use exponential backoff
- Use date range filters to reduce result set sizes
- Avoid polling at high frequency; fetch on demand
Error Handling
Common Error Codes
| Code |
Meaning |
Resolution |
| 401 |
Unauthorized |
Check X-SpamTitan-API-Key header value |
| 403 |
Forbidden |
Insufficient API key permissions |
| 404 |
Not Found |
Resource doesn't exist or wrong ID |
| 422 |
Unprocessable Entity |
Invalid request parameters |
| 429 |
Rate Limited |
Wait and retry after delay |
| 500 |
Server Error |
Retry; contact TitanHQ support if persistent |
Error Response Format
{
"error": {
"code": 401,
"message": "Invalid or missing API key"
}
}
Best Practices
- Narrow the quarantine queue with the filters that exist —
sender,
recipient, subject, reason — rather than paging the whole appliance.
There is no date filter and no domain filter on spamtitan_get_queue.
- To approximate per-customer scope on the queue, pass
recipient (a full
address) or filter the results client-side on the recipient's domain. Do not
tell an operator the listing is scoped to their customer when it is not.
spamtitan_get_stats does accept domain, so per-customer statistics are
genuinely scoped server-side. The asymmetry with the queue is the trap.
- There is no bulk release or bulk delete tool — both act on one
message_id
per call. Iterate deliberately and confirm each destructive call.
- Always confirm before deleting quarantined messages — deletion is irreversible
- Log all list management changes (allowlist/blocklist) for audit trail purposes,
using the
note parameter on spamtitan_manage_allowlist /
spamtitan_manage_blocklist
Related Skills
- quarantine - Quarantine queue management
- lists - Sender allowlist and blocklist management
1---2name: spamtitan-api-patterns3description: SpamTitan MCP fundamentals: the available tool catalog and its exact parameters, API-key header authentication, API structure, pagination, rate limiting, and error handling. Includes the tenant-isolation limit — spamtitan_get_queue takes no domain filter.4---56# SpamTitan MCP Tools & API Patterns78## Overview910The SpamTitan MCP server provides AI tool integration with the SpamTitan email security platform by TitanHQ. It exposes tools covering quarantine queue management, email flow statistics, and sender allowlist/blocklist management. The API uses an API key passed as an HTTP header.1112## Connection & Authentication1314### API Key Header Auth1516SpamTitan authenticates using an API key passed via HTTP header:1718| Header | Description |19|--------|-------------|20| `X-SpamTitan-API-Key` | Your SpamTitan API key |2122Generate credentials at: **SpamTitan Admin Interface > Settings > API**2324**Environment Variables:**2526```bash27export SPAMTITAN_API_KEY="your-api-key"28```2930> **IMPORTANT:** Never hardcode credentials. Always use environment variables.3132## Available MCP Tools3334The server registers nine tools. There is no separate `list` tool for either35sender list and no separate per-domain statistics tool — both capabilities are36arguments on the tools below.3738### Quarantine Management3940| Tool | Parameters | Description |41|------|------------|-------------|42| `spamtitan_get_queue` | `page`, `per_page`, `sender`, `recipient`, `subject`, `reason` | List messages in the quarantine queue. **No `domain` parameter — see the warning below.** |43| `spamtitan_get_message` | `message_id` (required) | Get details for a specific quarantined message |44| `spamtitan_release_message` | `message_id` (required) | Release a quarantined message to the recipient |45| `spamtitan_delete_message` | `message_id` (required) | ⚠ Permanently delete a quarantined message. Irreversible |4647> **⚠ `spamtitan_get_queue` cannot be scoped to a customer domain.** Its48> shipped input schema is exactly `page`, `per_page`, `sender`, `recipient`,49> `subject`, `reason` (`spamtitan-mcp/src/domains/quarantine.ts:21-53`). On a50> multi-tenant appliance the listing therefore spans every tenant, and51> per-customer filtering has to be done client-side on `recipient` after the52> fetch. This is easy to miss because the sibling `spamtitan_get_stats` *does*53> take `domain`. See the quarantine skill and `GOVERNANCE.md`.5455### Email Statistics5657| Tool | Parameters | Description |58|------|------------|-------------|59| `spamtitan_get_stats` | `period` (`today`\|`yesterday`\|`last_7_days`\|`last_30_days`\|`last_90_days`), `domain` | Email flow statistics. Pass `domain` for a single customer's numbers |6061Per-domain statistics are real — they are the `domain` argument on this tool,62not a separate tool.6364### List Management6566| Tool | Parameters | Description |67|------|------------|-------------|68| `spamtitan_manage_allowlist` | `action` (required: `add`\|`remove`\|`list`), `sender`, `note` | Add, remove, or list sender allowlist entries |69| `spamtitan_manage_blocklist` | `action` (required: `add`\|`remove`\|`list`), `sender`, `note` | ⚠ HIGH-IMPACT. Add, remove, or list sender blocklist entries. Changes deliverability for real users |7071Listing is `action: "list"` on the same tool — there is no separate list tool.72`action` is the only required parameter; `sender` is required by the handler73for `add` and `remove`. Omitting `action` makes the server elicit it from the74caller, which an unattended agent cannot answer.7576### Discovery7778| Tool | Parameters | Description |79|------|------------|-------------|80| `spamtitan_status` | — | Show credentials status and available domains |81| `spamtitan_navigate` | `domain` (required) | Discover tools by domain. This `domain` is a *tool category*, not a mail domain |8283## Pagination8485The quarantine queue uses page/per-page pagination:8687- Pass `page` (1-based) and `per_page` (default 50, max 200)88- Continue fetching pages until the result count is less than `per_page`8990**Example workflow:**91921. Call `spamtitan_get_queue` with `page=1`, `per_page=100`932. If 100 results returned, call again with `page=2`943. Repeat until fewer than `per_page` results are returned9596## Rate Limiting9798SpamTitan enforces API rate limits per API key:99100- HTTP 429 responses indicate rate limit exceeded101- Wait before retrying — use exponential backoff102- Use date range filters to reduce result set sizes103- Avoid polling at high frequency; fetch on demand104105## Error Handling106107### Common Error Codes108109| Code | Meaning | Resolution |110|------|---------|------------|111| 401 | Unauthorized | Check `X-SpamTitan-API-Key` header value |112| 403 | Forbidden | Insufficient API key permissions |113| 404 | Not Found | Resource doesn't exist or wrong ID |114| 422 | Unprocessable Entity | Invalid request parameters |115| 429 | Rate Limited | Wait and retry after delay |116| 500 | Server Error | Retry; contact TitanHQ support if persistent |117118### Error Response Format119120```json121{122 "error": {123 "code": 401,124 "message": "Invalid or missing API key"125 }126}127```128129## Best Practices130131- Narrow the quarantine queue with the filters that exist — `sender`,132 `recipient`, `subject`, `reason` — rather than paging the whole appliance.133 There is no date filter and no domain filter on `spamtitan_get_queue`.134- To approximate per-customer scope on the queue, pass `recipient` (a full135 address) or filter the results client-side on the recipient's domain. Do not136 tell an operator the listing is scoped to their customer when it is not.137- `spamtitan_get_stats` does accept `domain`, so per-customer statistics are138 genuinely scoped server-side. The asymmetry with the queue is the trap.139- There is no bulk release or bulk delete tool — both act on one `message_id`140 per call. Iterate deliberately and confirm each destructive call.141- Always confirm before deleting quarantined messages — deletion is irreversible142- Log all list management changes (allowlist/blocklist) for audit trail purposes,143 using the `note` parameter on `spamtitan_manage_allowlist` /144 `spamtitan_manage_blocklist`145146## Related Skills147148- [quarantine](../quarantine/SKILL.md) - Quarantine queue management149- [lists](../lists/SKILL.md) - Sender allowlist and blocklist management