Connect Gainsight PX to ChatGPT: Manage Users and Product Engagement
Learn how to generate a secure MCP server to connect Gainsight PX to ChatGPT. Automate user telemetry, feature adoption analysis, and engagement states.
If you want to connect Gainsight PX to ChatGPT so your AI agents can analyze feature adoption, track user telemetry, modify customer profiles, and control product engagement campaigns, you need a Model Context Protocol (MCP) server.
If your team uses Claude, check out our guide on connecting Gainsight PX to Claude or explore our broader architectural overview on connecting Gainsight PX to AI Agents.
Giving a Large Language Model (LLM) read and write access to a product analytics and engagement platform is a significant engineering task. You either spend weeks building, hosting, and maintaining a custom JSON-RPC layer to translate LLM arguments into Gainsight PX's highly specific payload structures, or you use a managed infrastructure layer to handle the translation for you.
This guide breaks down exactly how to use Truto to generate a secure, authenticated MCP server for Gainsight PX, connect it natively to ChatGPT, and execute complex product-led growth (PLG) workflows using natural language.
Gainsight PX to ChatGPT Quickstart Guide
If you just want the fastest path from a fresh Truto account to ChatGPT successfully calling the Gainsight PX API, follow these steps. Deeper architectural and security details are covered in the sections below.
What you need:
- A Truto account with API access.
- A Gainsight PX admin account to authorize the connection.
- A ChatGPT Pro, Plus, Business, Enterprise, or Education seat with Developer mode enabled.
Step 1: Connect Gainsight PX as an Integrated Account
First, you need to establish the connection. In the Truto dashboard, navigate to Integrated Accounts -> New Integrated Account, select Gainsight PX, and run through the authentication flow. Truto will securely store the credentials and handle any necessary token refreshes in the background, ensuring ChatGPT never encounters an expired session.
Once connected, note your integrated_account_id.
Step 2: Generate the Gainsight PX MCP Server
Truto dynamically generates MCP tools based on the underlying API documentation. You can expose these tools by creating an MCP Server scoped specifically to your newly connected Gainsight PX account.
Method A: Via the Truto UI
- Navigate to the integrated account page for your Gainsight PX connection.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration (e.g., restrict to
readmethods only, or tag filter forusers). - Copy the generated MCP server URL.
Method B: Via the API You can programmatically generate the server via a single POST request. This is particularly useful if you are programmatically provisioning AI workspaces for your internal teams.
curl -X POST https://api.truto.one/integrated-account/<YOUR_INTEGRATED_ACCOUNT_ID>/mcp \
-H "Authorization: Bearer $TRUTO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Gainsight PX for ChatGPT",
"config": {
"methods": ["read", "write", "custom"],
"tags": ["users", "accounts", "engagements"]
}
}'The response will contain a url field resembling https://api.truto.one/mcp/<token>. This URL single-handedly handles routing, tool generation, and authentication. Guard it closely.
Step 3: Connect the MCP Server to ChatGPT
With your MCP server URL ready, you can now expose the Gainsight PX tools to your ChatGPT workspace.
Method A: Via the ChatGPT UI
- Open ChatGPT and go to Settings -> Apps -> Advanced settings.
- Enable Developer mode.
- Under MCP servers / Custom connectors, click Add a new server.
- Name it something descriptive (e.g., "Gainsight PX Data").
- Paste your Truto MCP URL into the Server URL field and click Save.
Method B: Via Manual Config / CLI If you are running a custom ChatGPT client wrapper or local agent framework that accepts standard MCP configuration files, you can bind it using the SSE transport model:
{
"mcpServers": {
"gainsight-px": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/<YOUR_TOKEN>"
]
}
}
}Once connected, ChatGPT will immediately discover the Gainsight PX tools via the MCP tools/list protocol and make them available for natural language invocation.
The Engineering Reality of the Gainsight PX API
Building a custom MCP server means you own the entire API lifecycle. While the open MCP standard provides a predictable way for LLMs to discover tools via JSON-RPC, implementing it against Gainsight PX's highly specific API mechanics is difficult.
If you decide to hand-roll this integration, here are the specific operational quirks you will have to engineer around:
The Special Character Routing Problem
Gainsight PX allows users to be identified by custom strings (identifyId) and accounts by custom strings (accountId). Frequently, these identifiers are email addresses or contain special characters like @, +, or .. Standard REST path operations (like PATCH /users/:identifyId) will routinely fail or encounter URL encoding issues when the ID contains unescaped special characters.
Gainsight's API explicitly provides alternate endpoints - like updating a user via the request body instead of the URL path - solely to bypass this issue. If you build your own MCP server, you must write a routing middleware that detects special characters in the LLM's arguments and seamlessly hot-swaps the target endpoint. Truto handles this natively by providing explicit tools (e.g., gainsight_px_users_update_by_body) that map directly to the safe routes.
Fragmented Pagination Mechanisms
Standardizing pagination for an LLM is critical; if you expose raw API pagination, models will frequently hallucinate cursor values or miscalculate offsets. The Gainsight PX API is fragmented: the /users and /accounts endpoints return a scrollId which must be passed to retrieve the next page, while engagements and feature adoption metrics rely on a standard next_cursor or pageNumber index.
Truto standardizes this. When generating the MCP tool schemas, Truto intercepts list endpoints and automatically injects a normalized next_cursor property, explicitly instructing the LLM to pass the cursor back unaltered.
Engagement State Transition Traps
When an LLM attempts to automate engagement management, it will likely invoke a state update to pause or start a campaign. However, the Gainsight PX engagements.update_state method has strict state machine rules. If you attempt to start an engagement that is a never-launched draft, the API does not return a 400 Bad Request - it throws a hard HTTP 500 Internal Server Error. Furthermore, starting an engagement requires the underlying API key to have explicit Production Launch permissions. Truto passes these upstream errors back to the caller accurately so the LLM understands the specific state violation, rather than failing silently.
Core Gainsight PX Tools for ChatGPT
Truto exposes integration resources dynamically based on documented endpoints. Here are the highest-leverage hero tools to expose to your AI agents when managing Gainsight PX.
list_all_gainsight_px_users
Retrieves a paginated list of users. This is the foundational tool for audience analysis. It supports complex filtering and sorting, allowing the LLM to pull specific cohorts based on recent activity or custom attributes.
"Find all users in Gainsight PX who logged in during the last 30 days and have the role 'Admin'."
gainsight_px_users_update_by_body
Updates a user record using the request body for identification. This is critical for updating users whose identifyId contains special characters (like emails). It prevents URL-encoding failures when the LLM attempts to append new tags, update custom properties, or alter user states.
"Update the user with identifyId 'sarah.connor@example.com+test' and add the custom attribute 'beta_tester: true'."
list_all_gainsight_px_accounts
Fetches the organizational accounts associated with your users. Essential for B2B telemetry analysis, this tool lets the LLM group usage metrics by company and identify which accounts are heavily utilizing your platform versus those at risk of churn.
"Pull a list of all Gainsight PX accounts located in the EMEA region and sort them by their creation date."
list_all_gainsight_px_engagements
Retrieves all configured product engagements (in-app messages, banners, sliders, guides). The LLM can use this to audit what campaigns are currently active, paused, or in draft state across different environments.
"Give me a list of all active product engagements currently running in our production environment."
gainsight_px_engagements_update_state
Allows the LLM to pause or start a specific engagement. This is a highly sensitive action, but invaluable for automated incident response - for example, if an agent detects a critical app failure, it can automatically pause onboarding guides to prevent user frustration.
"Pause the engagement with ID 'eng-987654' immediately because the target feature is currently down."
list_all_gainsight_px_feature_adoption
Retrieves feature adoption statistics for a specific feature over a designated date range (maximum 7 days). This is the analytical powerhouse tool, allowing ChatGPT to act as a product analyst and interpret rollout success in real-time.
"Get the feature adoption numbers for feature ID 'feat-123' over the last 7 days and summarize the daily usage trend."
For the complete tool inventory and granular JSON Schema details covering external segments, KC Bots, custom events, and localization exports, view the Gainsight PX integration page.
Workflows in Action
Connecting ChatGPT to Gainsight PX unlocks powerful, autonomous product-led workflows. Here is how an AI agent executes real-world scenarios.
Scenario 1: Diagnosing Feature Adoption and Tagging Users
Product managers frequently need to identify which segments are ignoring a new feature release. Instead of manually exporting CSVs and running pivot tables, you can ask ChatGPT to handle the analysis and remediation.
"Check the feature adoption for feature ID 'feat-new-dashboard' over the last 7 days. Identify any users who have logged in but not used the feature, and update their profile with the tag 'needs_dashboard_nudge'."
Step-by-step execution:
- ChatGPT calls
list_all_gainsight_px_feature_adoptionto pull the recent statistics for 'feat-new-dashboard'. - It cross-references this by calling
list_all_gainsight_px_userswith a filter for recent logins to find active users missing from the adoption list. - For each identified user, the agent iterates through
gainsight_px_users_update_by_bodyto safely append the 'needs_dashboard_nudge' tag to their profile.
Outcome: The LLM successfully analyzes telemetry and updates the CRM state, allowing your marketing automation tools to pick up the newly tagged users for an email campaign.
Scenario 2: Halting an Underperforming Engagement
If a specific in-app guide or banner is causing user drop-off, speed is critical. You can instruct your AI agent to audit and halt the campaign immediately.
"Find the 'Q4 Upsell Banner' engagement. If it is currently active, pause it immediately."
Step-by-step execution:
- ChatGPT calls
list_all_gainsight_px_engagementsand filters the response to locate the ID for the 'Q4 Upsell Banner'. - It evaluates the returned
stateproperty to determine if the engagement is currently running. - It calls
gainsight_px_engagements_update_statewith the target ID and the command to pause.
sequenceDiagram
participant User
participant GPT as ChatGPT (MCP Client)
participant Truto as Truto MCP Server
participant PX as Gainsight PX API
User->>GPT: "Pause the Q4 Upsell Banner"
GPT->>Truto: Call tool: list_all_gainsight_px_engagements
Truto->>PX: GET /engagements
PX-->>Truto: Return engagement array
Truto-->>GPT: Return filtered engagement data
GPT->>Truto: Call tool: gainsight_px_engagements_update_state<br>{"id": "eng-123", "state": "PAUSE"}
Truto->>PX: POST /engagements/eng-123/state
PX-->>Truto: 200 OK (Paused)
Truto-->>GPT: Tool execution successful
GPT-->>User: "The engagement has been successfully paused."Outcome: The engagement is halted without anyone having to log into the Gainsight PX dashboard and navigate the rules engine.
Security and Access Control
When exposing a system as powerful as Gainsight PX to an LLM, you must enforce the principle of least privilege. Truto's MCP servers are designed to be explicitly scoped at the moment of creation.
- Method Filtering: You can restrict a server to only perform specific operations. By passing
config.methods: ["read"], the server will only generate tools forgetandlistoperations, effectively creating a read-only agent that cannot alter users or pause engagements. - Tag Filtering: Integration resources in Truto are tagged logically. By passing
config.tags: ["users", "accounts"], you prevent the MCP server from exposing tools related to administrative functions like KC Bots or external segments. - Secondary Authentication (
require_api_token_auth): By default, possessing the MCP URL grants access. For production environments, setting this flag totrueforces the MCP client to also pass a valid Truto API bearer token in the headers, adding a crucial layer of identity verification. - Automatic Expiry (
expires_at): You can generate ephemeral servers by passing a future ISO timestamp. Once reached, a durable alarm fires and automatically deletes the server and its corresponding KV storage, ensuring temporary access truly remains temporary.
Handling Gainsight PX Rate Limits
It is critical to understand how API limits are managed in this architecture. When the upstream Gainsight PX API enforces a rate limit and returns an HTTP 429 error, Truto does not automatically retry, throttle, or apply backoff logic.
Instead, Truto intercepts the 429 response and normalizes the upstream rate limit information into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). This error is passed straight through to ChatGPT. It is the responsibility of the calling client or the LLM orchestration framework to read these headers, respect the reset window, and execute the backoff logic. Truto ensures the error is visible and standard, but it will not artificially absorb the failure.
Moving Faster with Managed Infrastructure
Building an AI agent that can intelligently interact with Gainsight PX requires solving two distinct problems: reasoning and connectivity. ChatGPT handles the reasoning, but forcing your engineering team to build custom JSON-RPC schemas, manage special character routing, and normalize pagination across Gainsight's fragmented API is a massive waste of resources.
Truto's documentation-driven MCP generation shifts the burden of API translation entirely off your plate. By deriving tool schemas directly from validated integration configurations, you can connect AI agents to Gainsight PX in minutes, strictly control their access scope, and focus on building high-value PLG workflows.
FAQ
- Can ChatGPT automatically retry if the Gainsight PX API hits a rate limit?
- No. The Truto MCP server passes HTTP 429 rate limit errors directly back to the client. The LLM orchestration layer or the calling application is responsible for implementing retry logic and exponential backoff.
- How do I filter which Gainsight PX tools are exposed to ChatGPT?
- You can use Truto's MCP server configuration to filter tools by methods (e.g., read, write) or tags (e.g., users, engagements) during the creation of the server.
- Does this integration require writing custom API mapping code?
- No. Truto dynamically derives the tool schemas from the underlying Gainsight PX integration documentation and configurations, meaning no custom API parsing code is required to connect ChatGPT.
- Can I automatically expire ChatGPT's access to my Gainsight PX data?
- Yes. When creating the MCP server, you can set an `expires_at` timestamp. Once reached, the server is automatically destroyed via a background alarm, immediately revoking access.