Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
docs(cli): Expand and improve the MCP server and dev CLI command#3225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: "List dashboards" | ||
| openapi: "v3-openapi GET /api/v1/query/dashboards" | ||
| --- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: "Get query schema" | ||
| openapi: "v3-openapi GET /api/v1/query/schema" | ||
| --- | ||
ericallam marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -128,6 +128,93 @@ List all preview branches in the project. | ||
| - `"What preview branches exist?"` | ||
| - `"Show me preview deployments"` | ||
| ## Profile Tools | ||
| ### whoami | ||
| Show the current authenticated user, active CLI profile, email, and API URL. | ||
| **Example usage:** | ||
| - `"Who am I logged in as?"` | ||
| - `"What profile am I using?"` | ||
| ### list_profiles | ||
| List all configured CLI profiles and which one is currently active. | ||
| **Example usage:** | ||
| - `"What profiles do I have?"` | ||
| - `"Show me my Trigger.dev profiles"` | ||
| ### switch_profile | ||
| Switch the active CLI profile for this MCP session. This changes which Trigger.dev account and API URL are used for all subsequent tool calls. | ||
| **Example usage:** | ||
| - `"Switch to my production profile"` | ||
| - `"Use the staging profile"` | ||
| ## Query and Analytics Tools | ||
| ### get_query_schema | ||
| Get the schema for TRQL queries, including all available tables, their columns, data types, descriptions, and allowed values. Call this before using the query tool to understand what data is available. | ||
| **Example usage:** | ||
| - `"What tables and columns can I query?"` | ||
| - `"Show me the query schema"` | ||
| ### query | ||
| Execute a TRQL query against your Trigger.dev data. TRQL is a SQL-style query language for analyzing runs, metrics, and LLM usage. | ||
| **Example usage:** | ||
| - `"How many runs failed in the last 7 days?"` | ||
| - `"Show me the top 10 most expensive tasks"` | ||
| - `"Query the average execution duration by task"` | ||
| ### list_dashboards | ||
| List available built-in dashboards with their widgets. Each dashboard contains pre-built queries for common metrics. | ||
| **Example usage:** | ||
| - `"What dashboards are available?"` | ||
| - `"Show me the dashboard widgets"` | ||
| ### run_dashboard_query | ||
| Execute a single widget query from a built-in dashboard. Use `list_dashboards` first to see available dashboards and widget IDs. | ||
| **Example usage:** | ||
| - `"Run the total runs widget from the overview dashboard"` | ||
| - `"Show me the LLM cost over time from the AI dashboard"` | ||
| ## Dev Server Tools | ||
| ### start_dev_server | ||
| Start the Trigger.dev dev server (`trigger dev`) in the background. Waits up to 30 seconds for the worker to be ready. | ||
| **Example usage:** | ||
| - `"Start the dev server"` | ||
| - `"Run trigger dev"` | ||
| ### stop_dev_server | ||
| Stop the running Trigger.dev dev server. | ||
| **Example usage:** | ||
| - `"Stop the dev server"` | ||
| ### dev_server_status | ||
| Check the status of the dev server and view recent output. Shows whether it is stopped, starting, ready, or has errors. | ||
| **Example usage:** | ||
| - `"Is the dev server running?"` | ||
| - `"Show me the dev server logs"` | ||
| - `"Are there any build errors?"` | ||
Comment on lines
+131
to
+216
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 New MCP tools documented but not verified in MCP server code The Was this helpful? React with 👍 or 👎 to provide feedback. | ||
| <Callout type="warning"> | ||
| The deploy and list_preview_branches tools are not available when the MCP server is running with the `--dev-only` flag. | ||
| The deploy and list_preview_branches tools are not available when the MCP server is running with the `--dev-only` flag. The `--readonly` flag hides deploy, trigger_task, and cancel_run. | ||
| </Callout> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,14 +7,15 @@ description: "Query allows you to write custom queries against your data using T | ||
| - `runs`: contains all task run data including status, timing, costs, and task output. Run metadata (key-value set in your task) is not available on the Query page. | ||
| - `metrics`: contains metrics data for your runs including CPU, memory, and your custom metrics | ||
| - `llm_metrics`: contains LLM/AI metrics including token usage, costs, latency, and model performance data from GenAI spans | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 llm_metrics table documented as available but not yet in querySchemas The new line at Was this helpful? React with 👍 or 👎 to provide feedback. | ||
| ### `metrics` table columns | ||
| | Column | Type | Description | | ||
| | :--- | :--- | :--- | | ||
| | `metric_name` | string | Metric identifier (e.g., `process.cpu.utilization`) | | ||
| | `metric_type` | string | `gauge`, `sum`, or `histogram` | | ||
| | `value` | number | The observed value | | ||
| | `metric_value` | number | The observed value | | ||
| | `bucket_start` | datetime | 10-second aggregation bucket start time | | ||
| | `run_id` | string | Associated run ID | | ||
| | `task_identifier` | string | Task slug | | ||
| @@ -34,7 +35,7 @@ Use `prettyFormat()` to format metric values for display: | ||
| ```sql | ||
| SELECT | ||
| timeBucket(), | ||
| prettyFormat(avg(value), 'bytes') AS avg_memory | ||
| prettyFormat(avg(metric_value), 'bytes') AS avg_memory_usage | ||
| FROM metrics | ||
| WHERE metric_name = 'process.memory.usage' | ||
| GROUP BY timeBucket | ||
| @@ -225,7 +226,7 @@ Use `GROUP BY` with aggregate functions: | ||
| ```sql | ||
| SELECT | ||
| task_identifier, | ||
| avg(value) AS avg_memory | ||
| avg(metric_value) AS avg_memory | ||
| FROM metrics | ||
| WHERE metric_name = 'process.memory.usage' | ||
| GROUP BY task_identifier | ||
| @@ -529,7 +530,7 @@ Track process CPU utilization bucketed over time. | ||
| ```sql | ||
| SELECT | ||
| timeBucket(), | ||
| avg(value) AS avg_cpu | ||
| avg(metric_value) AS avg_cpu | ||
| FROM metrics | ||
| WHERE metric_name = 'process.cpu.utilization' | ||
| GROUP BY timeBucket | ||
| @@ -544,7 +545,7 @@ Average process memory usage per task identifier over the last 7 days. | ||
| ```sql | ||
| SELECT | ||
| task_identifier, | ||
| avg(value) AS avg_memory | ||
| avg(metric_value) AS avg_memory | ||
| FROM metrics | ||
| WHERE metric_name = 'process.memory.usage' | ||
| GROUP BY task_identifier | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1148,6 +1148,126 @@ paths: | ||
| "format": "json" | ||
| }' | ||
| "/api/v1/query/schema": | ||
| get: | ||
| operationId: get_query_schema_v1 | ||
| summary: Get query schema | ||
| description: Get the schema for TRQL queries, including all available tables, their columns, data types, descriptions, and allowed values. | ||
| responses: | ||
| "200": | ||
| description: Schema retrieved successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| tables: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: Table name used in TRQL queries | ||
| description: | ||
| type: string | ||
| description: Description of the table | ||
| timeColumn: | ||
| type: string | ||
| description: The primary time column for this table | ||
| columns: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: Column name | ||
| type: | ||
| type: string | ||
| description: ClickHouse data type | ||
| description: | ||
| type: string | ||
| description: Column description | ||
| example: | ||
| type: string | ||
| description: Example value | ||
| allowedValues: | ||
| type: array | ||
| items: | ||
| type: string | ||
| description: Allowed values for enum-like columns | ||
| coreColumn: | ||
| type: boolean | ||
| description: Whether this is a core column included in default queries | ||
| "401": | ||
| description: Unauthorized - API key is missing or invalid | ||
| tags: | ||
| - query | ||
| security: | ||
| - secretKey: [] | ||
| x-codeSamples: | ||
| - lang: curl | ||
| label: cURL | ||
| source: |- | ||
| curl "https://api.trigger.dev/api/v1/query/schema" \ | ||
| -H "Authorization: Bearer tr_dev_1234" | ||
| "/api/v1/query/dashboards": | ||
| get: | ||
| operationId: list_dashboards_v1 | ||
| summary: List built-in dashboards | ||
| description: List available built-in dashboards with their widgets. Each dashboard contains pre-built TRQL queries for common metrics like run success rates, costs, and LLM usage. | ||
| responses: | ||
| "200": | ||
| description: Dashboards listed successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| dashboards: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| key: | ||
| type: string | ||
| description: Dashboard identifier (e.g. "overview", "llm") | ||
| title: | ||
| type: string | ||
| description: Dashboard display title | ||
| widgets: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| id: | ||
| type: string | ||
| description: Widget identifier | ||
| title: | ||
| type: string | ||
| description: Widget display title | ||
| query: | ||
| type: string | ||
| description: The TRQL query this widget executes | ||
| type: | ||
| type: string | ||
| enum: [bignumber, chart, table] | ||
| description: Widget display type | ||
| "401": | ||
| description: Unauthorized - API key is missing or invalid | ||
| tags: | ||
| - query | ||
| security: | ||
| - secretKey: [] | ||
| x-codeSamples: | ||
| - lang: curl | ||
| label: cURL | ||
| source: |- | ||
| curl "https://api.trigger.dev/api/v1/query/dashboards" \ | ||
| -H "Authorization: Bearer tr_dev_1234" | ||
ericallam marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "/api/v1/runs/{runId}/reschedule": | ||
| parameters: | ||
| - $ref: "#/components/parameters/runId" | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.