const session = await callMCPTool("create_analysis_session", {
data_source_id: "model-guid-123" // Optional โ GUID of the ThoughtSpot worksheet or model to query. Omit to let ThoughtSpot automatically select the most relevant data source.
});
MCP tool reference (Spotter 3)
The new ThoughtSpot MCP integration exposes a session-based workflow for running natural language analytics queries against your ThoughtSpot data sources. The pattern is always: create a session โ send a message โ poll for updates.
create_analysis_session๐
Start an analytical session with ThoughtSpotโs analytics agent. This is the required first step before sending any questions.
Sessions are conversational. Once created, you can send multiple follow-up questions to the same session without calling create_analysis_session again.
Input parameter๐
The data_source_id is optional. Provide this when the user has specified or confirmed a data source, or when context makes a particular source obvious. Omit to let ThoughtSpot automatically select the most relevant source based on the question.
Example call๐
call_mcp_tool(
"create_analysis_session",
{
"data_source_id": "model-guid-123" # Optional โ GUID of the ThoughtSpot worksheet or model to query.
},
)
Response๐
{
"analytical_session_id": "session-guid-abc123"
}
-
analytical_session_id: Session ID. Pass this tosend_session_messageandget_session_updates. -
Always capture the returned
analytical_session_id. It is required for all subsequent calls.
send_session_message๐
Send a natural language analytical question or follow-up to an existing session. The agent processes requests asynchronously, so this tool does not return the answer directly; use get_session_updates to retrieve the response.
Input parameters๐
| Field | Description |
|---|---|
| The session to send the message to. Obtained from the |
| A natural language analytical question or follow-up to send to the ThoughtSpot agent. |
| Can be used to provide external information relating to the question. For example, โThe userโs fiscal year starts in Aprilโ, or โThe user is a manager of the West regionโ. |
Example call๐
const sendMessage = await callMCPTool("send_session_message", {
analytical_session_id: "sess_abc123", // Session ID from create_analysis_session.
message: "What were total sales by region last quarter?", // User's natural language question.
additional_context: "The user's fiscal year starts in April. " +
"Focus on underperforming regions only." // Optional โ external information to influence the analysis.
});
call_mcp_tool(
"send_session_message",
{
"analytical_session_id": "sess_abc123", # Session ID from create_analysis_session.
"message": "What were total sales by region last quarter?", # User's natural language question.
"additional_context": ( # Optional โ external information
"The user's fiscal year starts in April."
"Focus on underperforming regions only." # to influence the analysis.
),
},
)
Response๐
{
"success": true
}
-
success: Confirms whether the message was successfully received by the agent.
|
Note
|
|
get_session_updates๐
Poll for the latest response from a ThoughtSpot analytics session. Call this repeatedly after send_session_message until is_done is true.
Important: A single call to get_session_updates will rarely contain the full response. Spotter streams its work incrementally, including intermediate thinking steps, across multiple polling calls. You must accumulate updates from every poll and combine them to get the complete picture.
Input parameters๐
Send the analytical_session_id to specify the session to retrieve updates for.
Example call๐
const updates = await callMCPTool("get_session_updates", {
analytical_session_id: "session-guid-abc123" // Session ID from the `create_analysis_session` call.
});
call_mcp_tool(
"get_session_updates",
{"analytical_session_id": "sess_abc123"}, # Session ID from create_analysis_session.
)
Response๐
Poll returning intermediate updates with the "is_thinking" response:
{
"is_done": false,
"session_updates": [
{
"is_thinking":true,
"type":"text_chunk",
"text":"Let me look at your sales data by region...",
},
]
}
Poll returning final updates:
{
"is_done": true,
"session_updates":[
{
"is_thinking":false,
"type":"text-chunk",
"text":"Data broken down by region..."
},
{
"is_thinking":false,
"type":"text",
"text":"I'm interpreting 'last quarter' as Q4 2025 (OctoberโDecember), based on a fiscal year starting in April."
},
{
"is_thinking":false,
"type":"answer",
"answer_title":"Total Sales by Region โ Q4 2025",
"answer_query":"total sales by region last quarter",
"iframe_url":"https://your-instance.thoughtspot.cloud/embed/...",
"answer_id":"answer-guid-xyz789"
}
]
}
Handling streamed responses๐
Spotter queries are processed asynchronously and streamed in real time. This means the full response is never contained in a single get_session_updates call.
Each call to get_session_updates returns only the updates generated since the previous call. The session_updates array may indicate that Spotter is still processing with an is_thinking state, may include intermediate updates, or may contain several updates at once. Updates typically arrive as text or text-chunk types, reflecting Spotterโs ongoing reasoning, before the final answer update is provided. This intermediate content shows Spotterโs step-by-step thought process and should be preserved and presented to the user for transparency into how the answer is derived.
A typical response sequence might look like:
-
Thinking narration:
text-chunkupdates withis_thinkingstate describing what Spotter is doing. -
Clarifications or caveats:
textupdates explaining assumptions, filters applied, or potential ambiguities in the question. -
Intermediate conclusions: partial results or contextual notes before the final answer.
-
The final answer: one or more
answerupdates containing the visualization title, the underlying query, and the embeddable iframe URL.
This means a complete response might span between 5โ20+ get_session_updates calls and contain many session_update objects before is_done becomes true. All of this content โ the thinking, the narration, and the final answer โ should be accumulated and presented together to give the user the full picture.
Type definition: session_update๐
Each item in the session_updates list is a session_update object. The type field determines which other fields are present.
| Field | Type | Description |
|---|---|---|
|
| A complete natural language message from the agent. |
| A streaming chunk of a longer message. Concatenate all chunks to reconstruct the full text. | |
| Populates | |
| String | The text content of the message. Present only when |
| String | A human-readable title describing what the answer shows. Present only when |
| String | The search query ThoughtSpot used to generate the answer. Present only when |
| String | An embeddable URL for rendering the answer as an interactive visualization. Present only when |
create_dashboard๐
Create a ThoughtSpot dashboard from answers generated in an analysis session.
-
Call this only after
get_session_updatesreturnsis_done: true, because you need theanswer_idvalues from completed answer updates. -
Collect all updates where type is answer across every poll of
get_session_updates. Each one produces ananswer_idyou can include in the dashboard. -
The
note_tileshould summarize the full analysis. It is the first thing a viewer sees on the dashboard. -
Multiple answers from the same session or across multiple sessions can be combined into a single dashboard.
Input parameters๐
| Field | Description |
|---|---|
| Required. Title of the dashboard to be created. |
| Required. List of answer objects to add to the dashboard. Each answer requires an |
| Required. An HTML summary of the analysis and answers, rendered as a styled tile on the dashboard. Must be a single line with no line breaks. Use |
Example call๐
const dashboard = await callMCPTool("create_dashboard", {
title: "Q4 2025 Regional Sales Analysis",
answers: [{
answer_id: "ans_xyz789", // answer_id from each answer-type update returned by get_session_updates.
title: "Total Sales by Region โ Q4 2025"
},
{
answer_id: "ans_xyz790",
title: "Underperforming Regions โ Q4 2025 vs Q4 2024"
}
],
note_tile: "<h2 style='text-align:center;'> Q4 2025 Regional Sales Analysis</h2>" +
"<p>Analysis of total sales by region for Q4 2025, highlighting " +
"top-performing and underperforming regions.<br>" +
"Generated on 2026-04-16 10:00 AM</p>" // Required โ single-line HTML string rendered as a styled summary tile at the top of the dashboard.
});
dashboard = call_mcp_tool(
"create_dashboard",
{
"title": "Q4 2025 Regional Sales Analysis",
"answers": [
{
"answer_id": "ans_xyz789", # answer_id from each answer-type update returned by get_session_updates.
"title": "Total Sales by Region โ Q4 2025",
},
{
"answer_id": "ans_xyz790",
"title": "Underperforming Regions โ Q4 2025 vs Q4 2024",
},
],
"note_tile": (
"<h2 style='text-align:center;'> Q4 2025 Regional Sales Analysis</h2>"
"<p>Analysis of total sales by region for Q4 2025, highlighting "
"top-performing and underperforming regions.<br>"
"Generated on 2026-04-16 10:00 AM</p>" # Required. single-line HTML string rendered as a styled summary tile at the top of the dashboard.
),
},
)
Response๐
| Field | Description |
|---|---|
| The unique identifier of the created dashboard. |
| A link to the newly created dashboard in ThoughtSpot. |
Visualizations embedded in iframe๐
When displaying the embedded visualization using the iframe_url property, the following user interaction features are included by default:
| Area | Option | Visibility |
|---|---|---|
Primary actions and actions in the More ( | Pin | Visible |
Save | Visible | |
Download | Visible | |
Edit | Not visible | |
Add to Coaching | Not visible | |
Context menu actions | Aggregate | Visible |
Filter | Visible | |
Sort | Visible | |
Position | Visible | |
Conditional formatting | Not visible | |
Rename | Not visible | |
Edit | Not visible | |
Remove | Not visible | |
Axis menu | Exclude | Visible |
Only include | Visible | |
Drill down | Visible | |
Show underlying data | Visible |
The following features are not supported directly. However, you can use the Make a Copy option to access these capabilities:
-
Drill down
-
Changing filters
-
Changing chart type or chart configuration
-
Show underlying data, view query SQL or query visualizer
-
SpotIQ analysis
Additional resources๐
-
For a chat client example, see Python Agent with Simple React UI.
-
For information about rendering iframe visualizations, see the startAutoMCPFrameRenderer function reference.