run_analysis
Run a natural-language analytics question against your connected data sources. Consumes AI credits. Returns either the completed analysis result inline OR a job_id you can poll with get_analysis_status. If list_data_sources returns an empty list, ingest data first with upload_data_source (inline base64), ingest_url_data_source (public URL), or request_oauth_integration_url (Google / Meta / Jira / Confluence).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | Natural language question to analyze. E.g. "What was revenue last quarter by region?". | |
| session_id | No | Optional existing conversation session UUID. | |
| wait_seconds | No | How long (seconds) to wait for the job to finish before returning a job_id for polling. 0 = always return immediately. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | ||
| result | No | Analysis envelope (headline metric, chart data, follow-ups). Present when status is "completed". | |
| status | Yes | Job status, e.g. "completed", "running", "queued". | |
| poll_url | No | Present when the job is still running. Poll get_analysis_status instead for structured progress. | |
| ai_credits_used | No | ||
| ai_credits_limit | No |