Skip to content

Connect Attentive to ChatGPT: Manage Segments and Subscriber Data

Learn how to connect Attentive to ChatGPT using a managed MCP server. Automate subscriber segmentation, custom events, and CCPA deletions via natural language.

Yuvraj Muley Yuvraj Muley · · 9 min read
Connect Attentive to ChatGPT: Manage Segments and Subscriber Data

If you want to connect Attentive to ChatGPT to manage subscriber data, sync custom attributes, and orchestrate SMS marketing segments, you need a Model Context Protocol (MCP) server. If your team uses Claude, check out our guide on connecting Attentive to Claude or explore our broader architectural overview on connecting Attentive to AI Agents.

Giving a Large Language Model (LLM) read and write access to an enterprise SMS marketing platform is an engineering challenge. You either spend weeks building, hosting, and maintaining a custom MCP server to translate LLM JSON arguments into Attentive's highly specific subscriber payload structures, or you use a managed infrastructure layer.

This guide breaks down exactly how to use Truto to generate a secure, authenticated MCP server for Attentive, connect it natively to ChatGPT, and execute complex workflows - including bulk segment operations and identity resolution - using natural language.

Stop writing boilerplate API integration code. Let Truto generate secure, managed MCP servers for your AI agents in seconds. :::

The Engineering Reality of the Attentive API

A custom MCP server acts as a self-hosted integration layer. While the open MCP standard provides a predictable way for ChatGPT to discover tools, implementing it against Attentive's API is exceptionally painful.

If you decide to build a custom MCP server for Attentive, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with Attentive:

Identity Resolution and Strict Identifiers

Attentive's API does not rely on a single primary key for users. Instead, it uses a complex identity resolution system relying on phone, email, and clientUserId. When you upsert a user via the API, you must provide at least one of these. Furthermore, phone numbers must strictly adhere to the E.164 format. If ChatGPT hallucinates a phone number format (e.g., (555) 123-4567 instead of +15551234567), the API will reject the payload. Your MCP schema must enforce strict validation rules to guide the LLM.

Asynchronous Bulk Operations

Many of Attentive's highest-leverage endpoints - like adding members to a segment - do not process synchronously. When you call the bulk segment addition endpoint, Attentive queues the request and returns a batchJobId. Your integration layer must then poll a separate job status endpoint to confirm success. Exposing this directly to an LLM requires chaining tool calls: the LLM must first submit the bulk job, store the ID in its context window, and then intentionally call the status endpoint in a loop to verify the operation.

Custom Attribute Constraints

Attentive allows custom attributes on subscribers, but with severe restrictions: a maximum of 100 attributes per user, a 200-character limit on attribute names, and strict rejections of arrays or nested JSON maps. If an LLM attempts to push a complex nested object into a custom attribute field, the Attentive API will throw a 400 error. The MCP tool schema must be rigidly defined to prevent the LLM from attempting to map unsupported data structures.

Rate Limit Passthrough and Handling

Attentive enforces rate limits across its endpoints. It is important to note that Truto does not retry, throttle, or apply backoff on rate limit errors. When the Attentive API returns an HTTP 429 Too Many Requests, Truto passes that error directly to the caller (ChatGPT). However, Truto does normalize upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. Your client infrastructure or the LLM's system prompt must be designed to catch these 429s and gracefully back off.

Step-by-Step: Generate and Connect the MCP Server

To bridge ChatGPT and Attentive, we need to authenticate an account, generate an MCP server URL, and feed that URL into ChatGPT. Truto handles the OAuth flows, token refreshes, and dynamic tool generation based on the integration's documentation records.

Step 1: Create the MCP Server

You can generate an MCP server scoped specifically to an authenticated Attentive account using either the Truto UI or the Truto REST API.

Method A: Via the Truto UI

  1. Log into your Truto dashboard and navigate to Integrated Accounts.
  2. Select your connected Attentive account (or connect one via the OAuth flow).
  3. Click the MCP Servers tab.
  4. Click Create MCP Server.
  5. Select your configuration (e.g., restrict to write methods, filter by tags like segments or users).
  6. Click Save and copy the generated MCP server URL (it will look like https://api.truto.one/mcp/<token>).

Method B: Via the API For programmatic setups, you can generate the server via a single POST request. Grab your integrated_account_id and run:

curl -X POST https://api.truto.one/integrated-account/<INTEGRATED_ACCOUNT_ID>/mcp \
  -H "Authorization: Bearer $TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Attentive Marketing Agent",
    "config": {
      "methods": ["read", "write"],
      "tags": ["users", "segments", "events"]
    }
  }'

The response contains the exact URL needed by ChatGPT. This URL contains a hashed token that authenticates requests routing to this specific Attentive workspace.

Step 2: Connect the MCP Server to ChatGPT

Once you have the URL, you must register it as a custom connector in ChatGPT. You can do this via the ChatGPT UI or using a local configuration approach for custom clients.

Method A: Via the ChatGPT UI

  1. Open ChatGPT and navigate to Settings -> Apps -> Advanced settings.
  2. Toggle Developer mode on (MCP support requires Pro, Plus, Business, Enterprise, or Education tiers).
  3. Under the custom connectors section, click Add new server.
  4. Name the connection (e.g., "Attentive Marketing").
  5. Paste the Truto MCP URL into the Server URL field.
  6. Save the configuration. ChatGPT will immediately perform a handshake, calling the tools/list protocol method to discover all available Attentive capabilities.

Method B: Via Manual Config File (for headless / SSE setups) If you are using a local agent framework or testing the connection locally via Server-Sent Events (SSE), you can configure your environment using the @modelcontextprotocol/server-sse package. In your framework's configuration file (similar to Claude Desktop's config JSON), define the server like this:

{
  "mcpServers": {
    "attentive_marketing": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/<YOUR_TOKEN>"
      ]
    }
  }
}

Hero Tools for Attentive Automation

When ChatGPT connects to the MCP server, Truto dynamically generates tools based on the endpoints available in the Attentive API. Below are the highest-leverage hero tools for automating SMS workflows.

Create a Segment

Tool Name: create_a_attentive_segment Creates a new, empty segment in Attentive. This is the prerequisite for building custom marketing lists on the fly. The LLM only needs to provide a name for the segment.

"Create a new segment in Attentive called 'Q4 High Value SMS Churn Risks'."

Add Members to a Segment (Bulk)

Tool Name: create_a_attentive_segments_member Adds members to a segment in bulk using their email, phone, or clientUserId. Because this is an asynchronous job, it returns a batchJobId rather than a synchronous success message.

"Add these five E.164 formatted phone numbers to the segment ID 98765. Give me the batch job ID so we can check on it later."

Create or Update a User Attribute

Tool Name: create_a_attentive_user_attribute Creates or updates a single user, their subscriptions, and custom attributes. If a user matching the provided identifiers already exists, they are updated; otherwise, a new user is created. This is vital for syncing CRM data into Attentive for personalization.

"Update the Attentive user with phone +15550198372. Set their custom attribute 'LTV' to '1500' and 'last_purchase_date' to today."

Send a Custom Event

Tool Name: create_a_attentive_custom_event Fires an event-based record of a user action into Attentive. These custom events are used to trigger Journey Builders (e.g., an abandoned cart or a custom onboarding milestone).

"Fire a custom event named 'loyalty_tier_upgraded' for the user with email VIP@example.com."

Process a CCPA Privacy Delete Request

Tool Name: create_a_attentive_privacy_delete_request Creates a privacy deletion request to remove a subscriber entirely within 30 days. This requires either the subscriberPhone or subscriberEmail.

"We received a GDPR right-to-be-forgotten request. Submit a privacy delete request for the subscriber with phone +15559998888."

List Subscriptions and Eligibility

Tool Name: list_all_attentive_subscriptions Checks a user's subscription eligibility and lists all types and channels they are subscribed to. This is a critical check before attempting to send SMS or email messages to ensure compliance.

"Check the subscription status for +15551234567 to see if they are eligible to receive marketing SMS messages."

For the complete inventory of available Attentive tools, query schemas, and response types, visit the Attentive integration page.

Workflows in Action

Giving ChatGPT raw tools is powerful, but true automation happens when the LLM chains these tools together to execute multi-step workflows. Here are two real-world examples of how an AI agent operates against the Attentive API.

Workflow 1: VIP Subscriber Segmentation

Marketers often identify high-value users in a CRM or chat context and want to immediately push them into an Attentive segment for a specialized SMS drop.

"I have a list of three phone numbers (+15551112222, +15553334444, +15555556666) for our new VIPs. Create a new segment called 'November VIPs' and add these users to it. Update their custom attribute 'VIP_Status' to 'Active'."

Step-by-step execution:

  1. The agent calls create_a_attentive_segment with the name "November VIPs" and retrieves the new segment ID.
  2. The agent loops through the users and calls create_a_attentive_user_attribute for each, mapping the phone number and setting the custom attribute.
  3. The agent calls create_a_attentive_segments_member passing the new segment ID and the array of phone numbers. It receives a batchJobId back, confirming the bulk job has been queued by Attentive.
sequenceDiagram
    participant User as User
    participant ChatGPT as ChatGPT
    participant Truto as Truto MCP
    participant Upstream as "Attentive API"

    User->>ChatGPT: "Create a segment, update attributes, and add these users."
    ChatGPT->>Truto: call tool: create_a_attentive_segment
    Truto->>Upstream: POST /segments
    Upstream-->>Truto: Return segment ID (e.g., 1045)
    Truto-->>ChatGPT: Return segment ID
    
    ChatGPT->>Truto: call tool: create_a_attentive_user_attribute (loop)
    Truto->>Upstream: POST /users
    Upstream-->>Truto: 202 Accepted
    Truto-->>ChatGPT: Success confirmation

    ChatGPT->>Truto: call tool: create_a_attentive_segments_member
    Truto->>Upstream: POST /segments/1045/members
    Upstream-->>Truto: Return batchJobId
    Truto-->>ChatGPT: Return batchJobId
    ChatGPT->>User: "Segment created, attributes updated, and bulk addition job submitted."

Workflow 2: Automated Compliance Deletion

Handling privacy requests manually is error-prone. An AI agent can ingest a request from an inbox, verify the user in Attentive, and issue the deletion command.

"A user emailed us from privacy@example.com asking to delete all their data. Find their subscriptions in Attentive and submit a deletion request."

Step-by-step execution:

  1. The agent calls list_all_attentive_subscriptions using the provided email to verify the user exists in the Attentive database.
  2. The agent calls create_a_attentive_privacy_delete_request with the email address to formally initiate the CCPA/GDPR deletion process.
  3. The agent receives the deletion request ID and reports it back to the user for compliance tracking.
flowchart TD
    A["User Prompt:<br>Delete user data for privacy@example.com"] --> B["Agent Tool Call:<br>list_all_attentive_subscriptions"]
    B --> C{"User exists?"}
    C -- Yes --> D["Agent Tool Call:<br>create_a_attentive_privacy_delete_request"]
    C -- No --> E["Agent Reply:<br>No active records found"]
    D --> F["Agent Reply:<br>Deletion request logged with ID"]

Security and Access Control

Exposing an SMS marketing platform to an LLM requires strict boundary setting. The Truto MCP server provides several mechanisms to lock down what ChatGPT can do.

  • Method Filtering: Configure the MCP token with config.methods = ["read"] to allow ChatGPT to look up subscribers and segments, while strictly denying it the ability to create segments, fire events, or delete users.
  • Tag Filtering: Use config.tags = ["events"] to restrict the LLM to only interacting with custom event endpoints, keeping it away from core subscriber data or webhooks.
  • API Token Enforcement: By enabling require_api_token_auth: true, the MCP server URL alone is not enough to connect. The client must also pass a valid Truto API token in the Authorization header, adding a second layer of identity verification.
  • Time-To-Live (TTL): Set an expires_at timestamp when generating the server. Once the timestamp passes, the server URL automatically self-destructs, making it perfect for temporary troubleshooting sessions or ephemeral AI workflows.

Strategic Wrap-Up

Connecting Attentive to ChatGPT via a custom-built integration layer is a massive time sink. Between handling asynchronous batch jobs, mapping strict custom attribute constraints, and standardizing error handling for rate limits, your engineering team could lose weeks to maintenance.

By leveraging Truto's dynamically generated MCP servers, you transform Attentive's API surface into native, LLM-ready tools instantly. This architecture allows your AI agents to build segments, update subscriber data, and execute marketing workflows autonomously, while keeping your engineering team out of the integration weeds.

FAQ

Does the Truto MCP server automatically retry on Attentive API rate limits?
No. Truto does not retry, throttle, or apply backoff on rate limit errors. If Attentive returns an HTTP 429 Too Many Requests, Truto passes that error directly to the caller. However, Truto does normalize the upstream rate limit data into standard headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) so your client can handle the backoff.
How do I handle bulk segment additions via the LLM?
Bulk segment additions in Attentive are asynchronous. The LLM must call the `create_a_attentive_segments_member` tool, which returns a batchJobId. The LLM can then optionally use the bulk job status tool to check if the addition has completed.
Can I prevent ChatGPT from sending SMS messages or deleting users?
Yes. When creating the MCP server via Truto, you can pass a configuration object that filters available tools by method (e.g., read-only) or by tags, ensuring the LLM only has access to safe endpoints.
What happens when an MCP server expires?
If you set an expires_at timestamp during server creation, the URL will automatically become invalid at that time. Truto's infrastructure automatically cleans up the token from both KV storage and the database, instantly revoking access.

More from our Blog