sequentum-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,782 @@
1
+ # Tool Reference
2
+
3
+ This document provides detailed documentation for all tools available in the Sequentum MCP server.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Agent Management](#agent-management)
8
+ - [list_agents](#list_agents)
9
+ - [get_agent](#get_agent)
10
+ - [search_agents](#search_agents)
11
+ - [Run Management](#run-management)
12
+ - [get_agent_runs](#get_agent_runs)
13
+ - [get_run_status](#get_run_status)
14
+ - [start_agent](#start_agent)
15
+ - [stop_agent](#stop_agent)
16
+ - [File Management](#file-management)
17
+ - [get_run_files](#get_run_files)
18
+ - [get_file_download_url](#get_file_download_url)
19
+ - [Version Management](#version-management)
20
+ - [get_agent_versions](#get_agent_versions)
21
+ - [restore_agent_version](#restore_agent_version)
22
+ - [Schedule Management](#schedule-management)
23
+ - [list_agent_schedules](#list_agent_schedules)
24
+ - [create_agent_schedule](#create_agent_schedule)
25
+ - [delete_agent_schedule](#delete_agent_schedule)
26
+ - [get_scheduled_runs](#get_scheduled_runs)
27
+ - [Billing & Credits](#billing--credits)
28
+ - [get_credits_balance](#get_credits_balance)
29
+ - [get_spending_summary](#get_spending_summary)
30
+ - [get_credit_history](#get_credit_history)
31
+ - [Space Management](#space-management)
32
+ - [list_spaces](#list_spaces)
33
+ - [get_space](#get_space)
34
+ - [get_space_agents](#get_space_agents)
35
+ - [search_space_by_name](#search_space_by_name)
36
+ - [run_space_agents](#run_space_agents)
37
+ - [Analytics & Diagnostics](#analytics--diagnostics)
38
+ - [get_runs_summary](#get_runs_summary)
39
+ - [get_records_summary](#get_records_summary)
40
+ - [get_run_diagnostics](#get_run_diagnostics)
41
+ - [get_latest_failure](#get_latest_failure)
42
+
43
+ ---
44
+
45
+ ## Agent Management
46
+
47
+ ### list_agents
48
+
49
+ List web scraping agents with IDs, names, status, and configuration.
50
+
51
+ **Use this first** to discover available agents before running or managing them.
52
+
53
+ #### Parameters
54
+
55
+ | Name | Type | Required | Description |
56
+ |------|------|----------|-------------|
57
+ | `status` | number | No | Filter by last run status. See [Run Status Values](#run-status-values). |
58
+ | `spaceId` | number | No | Filter by space ID. Use `list_spaces` first to find space IDs. |
59
+ | `search` | string | No | Search by agent name (case-insensitive partial match). |
60
+ | `configType` | string | No | Filter by type: `Agent`, `Command`, `Api`, or `Shared`. |
61
+ | `sortColumn` | string | No | Column to sort by: `name`, `lastActivity`, `created`, `updated`, `status`, `configType`. |
62
+ | `sortOrder` | string | No | Sort direction: `asc` (ascending) or `desc` (descending). |
63
+ | `pageIndex` | number | No | Page number (1-based). Defaults to 1. |
64
+ | `recordsPerPage` | number | No | Results per page. Defaults to 50. Max recommended: 100. |
65
+
66
+ #### Returns
67
+
68
+ Array of agent summaries with `id`, `name`, `status`, `configType`, `version`, `lastActivity`.
69
+
70
+ #### Example Prompts
71
+
72
+ ```
73
+ List all my web scraping agents
74
+ Show me agents that failed recently
75
+ Find agents with "amazon" in the name
76
+ ```
77
+
78
+ ---
79
+
80
+ ### get_agent
81
+
82
+ Get detailed information about a specific agent including its configuration, input parameters, and documentation.
83
+
84
+ #### Parameters
85
+
86
+ | Name | Type | Required | Description |
87
+ |------|------|----------|-------------|
88
+ | `agentId` | number | Yes | The unique ID of the agent. Get this from `list_agents` or `search_agents`. |
89
+
90
+ #### Returns
91
+
92
+ Full agent details including `inputParameters`, `description`, `documentation`, `startUrl`.
93
+
94
+ #### Example Prompts
95
+
96
+ ```
97
+ Tell me about agent 123
98
+ What parameters does agent 456 need?
99
+ Show agent configuration for ID 789
100
+ ```
101
+
102
+ ---
103
+
104
+ ### search_agents
105
+
106
+ Search for agents by name or description (case-insensitive partial match). Faster than `list_agents` when you know part of the agent name.
107
+
108
+ #### Parameters
109
+
110
+ | Name | Type | Required | Description |
111
+ |------|------|----------|-------------|
112
+ | `query` | string | Yes | Search term to match against agent names and descriptions. |
113
+ | `maxRecords` | number | No | Maximum results to return. Default: 50, Max: 1000. |
114
+
115
+ #### Returns
116
+
117
+ Matching agents with `id`, `name`, `status`, `configType`.
118
+
119
+ #### Example Prompts
120
+
121
+ ```
122
+ Find the Amazon scraper
123
+ Which agent handles product data?
124
+ Search for pricing agents
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Run Management
130
+
131
+ ### get_agent_runs
132
+
133
+ Get execution history for an agent showing past runs with status, timing, and records extracted.
134
+
135
+ #### Parameters
136
+
137
+ | Name | Type | Required | Description |
138
+ |------|------|----------|-------------|
139
+ | `agentId` | number | Yes | The unique ID of the agent. |
140
+ | `maxRecords` | number | No | Maximum number of runs to return. Default: 50. |
141
+
142
+ #### Returns
143
+
144
+ Array of runs with `id`, `status`, `startTime`, `endTime`, `recordsExtracted`, `recordsExported`, `errorMessage`.
145
+
146
+ #### Example Prompts
147
+
148
+ ```
149
+ When did agent 123 last run?
150
+ Show run history for agent 456
151
+ How many records were extracted by agent 789?
152
+ ```
153
+
154
+ ---
155
+
156
+ ### get_run_status
157
+
158
+ Get the current status of a specific run. Faster than `get_agent_runs` when you only need one run's status.
159
+
160
+ #### Parameters
161
+
162
+ | Name | Type | Required | Description |
163
+ |------|------|----------|-------------|
164
+ | `agentId` | number | Yes | The unique ID of the agent. |
165
+ | `runId` | number | Yes | The run ID returned by `start_agent` or found in `get_agent_runs`. |
166
+
167
+ #### Returns
168
+
169
+ Single run with `status`, timing, records extracted.
170
+
171
+ #### Example Prompts
172
+
173
+ ```
174
+ Is run 123 still running?
175
+ Did that run complete?
176
+ Check status of run 456
177
+ ```
178
+
179
+ ---
180
+
181
+ ### start_agent
182
+
183
+ Start a web scraping agent execution. Two modes available:
184
+
185
+ 1. **Async (default)**: Returns immediately with `runId`. Use `get_run_status` to monitor progress.
186
+ 2. **Sync**: Set `isRunSynchronously=true` to wait and get scraped data directly (best for quick agents under 60 seconds).
187
+
188
+ #### Parameters
189
+
190
+ | Name | Type | Required | Description |
191
+ |------|------|----------|-------------|
192
+ | `agentId` | number | Yes | The unique ID of the agent to run. |
193
+ | `inputParameters` | string | No | JSON string of input parameters. Check agent's `inputParameters` with `get_agent`. Example: `'{"url": "https://example.com"}'` |
194
+ | `isRunSynchronously` | boolean | No | If `true`, wait for completion and return scraped data. Default: `false`. |
195
+ | `timeout` | number | No | Timeout in seconds for synchronous runs. Default: 60. |
196
+ | `parallelism` | number | No | Number of parallel instances. Default: 1. |
197
+
198
+ #### Returns
199
+
200
+ - **Async mode**: `{runId, status}`
201
+ - **Sync mode**: Scraped data directly as JSON/text
202
+
203
+ #### Example Prompts
204
+
205
+ ```
206
+ Run agent 123
207
+ Start the Amazon scraper with URL https://amazon.com/product/123
208
+ Execute agent 456 synchronously and show me the results
209
+ ```
210
+
211
+ ---
212
+
213
+ ### stop_agent
214
+
215
+ Stop a running agent execution immediately. Use to cancel runs that are taking too long or no longer needed.
216
+
217
+ #### Parameters
218
+
219
+ | Name | Type | Required | Description |
220
+ |------|------|----------|-------------|
221
+ | `agentId` | number | Yes | The unique ID of the agent. |
222
+ | `runId` | number | Yes | The run ID to stop. Get this from `start_agent` response or `get_agent_runs`. |
223
+
224
+ #### Returns
225
+
226
+ Confirmation message that the run was stopped.
227
+
228
+ #### Example Prompts
229
+
230
+ ```
231
+ Stop run 123 for agent 456
232
+ Cancel the scraper
233
+ Abort that running job
234
+ ```
235
+
236
+ ---
237
+
238
+ ## File Management
239
+
240
+ ### get_run_files
241
+
242
+ List all output files generated by a completed run. Files contain scraped data in formats like CSV, JSON, Excel.
243
+
244
+ #### Parameters
245
+
246
+ | Name | Type | Required | Description |
247
+ |------|------|----------|-------------|
248
+ | `agentId` | number | Yes | The unique ID of the agent. |
249
+ | `runId` | number | Yes | The run ID. Get this from `get_agent_runs` or `start_agent` response. |
250
+
251
+ #### Returns
252
+
253
+ Array of files with `id`, `name`, `fileType`, `fileSize`, `created`.
254
+
255
+ #### Example Prompts
256
+
257
+ ```
258
+ What files did run 123 produce?
259
+ Show output files for agent 456 run 789
260
+ Where is the scraped data?
261
+ ```
262
+
263
+ ---
264
+
265
+ ### get_file_download_url
266
+
267
+ Get a temporary download URL for a specific output file. The URL expires after a short time.
268
+
269
+ #### Parameters
270
+
271
+ | Name | Type | Required | Description |
272
+ |------|------|----------|-------------|
273
+ | `agentId` | number | Yes | The unique ID of the agent. |
274
+ | `runId` | number | Yes | The run ID. |
275
+ | `fileId` | number | Yes | The file ID from `get_run_files` response. |
276
+
277
+ #### Returns
278
+
279
+ Temporary URL that can be used to download the file directly.
280
+
281
+ #### Example Prompts
282
+
283
+ ```
284
+ Download the CSV file from run 123
285
+ Get me a download link for file 456
286
+ Give me the output data file
287
+ ```
288
+
289
+ ---
290
+
291
+ ## Version Management
292
+
293
+ ### get_agent_versions
294
+
295
+ List all saved versions of an agent's configuration. Use for reviewing change history or finding a version to restore.
296
+
297
+ #### Parameters
298
+
299
+ | Name | Type | Required | Description |
300
+ |------|------|----------|-------------|
301
+ | `agentId` | number | Yes | The unique ID of the agent. |
302
+
303
+ #### Returns
304
+
305
+ Array of versions with `version` number, `userName` (who made the change), `created` date, `comments`, `fileSize`.
306
+
307
+ #### Example Prompts
308
+
309
+ ```
310
+ Show agent version history for 123
311
+ What changes were made to agent 456?
312
+ List previous versions of the scraper
313
+ ```
314
+
315
+ ---
316
+
317
+ ### restore_agent_version
318
+
319
+ Restore an agent to a previous version. This creates a new version based on the restored configuration.
320
+
321
+ **Warning**: This modifies the agent. Use `get_agent_versions` first to find the correct version number.
322
+
323
+ #### Parameters
324
+
325
+ | Name | Type | Required | Description |
326
+ |------|------|----------|-------------|
327
+ | `agentId` | number | Yes | The unique ID of the agent. |
328
+ | `versionNumber` | number | Yes | The version number to restore to. Get this from `get_agent_versions`. |
329
+ | `comments` | string | Yes | Explanation for why this version is being restored. Will be recorded in version history. |
330
+
331
+ #### Returns
332
+
333
+ Confirmation that the agent was restored and a new version was created.
334
+
335
+ #### Example Prompts
336
+
337
+ ```
338
+ Restore agent 123 to version 5
339
+ Roll back the Amazon scraper to yesterday's version
340
+ Undo agent changes - go back to version 3
341
+ ```
342
+
343
+ ---
344
+
345
+ ## Schedule Management
346
+
347
+ ### list_agent_schedules
348
+
349
+ List all scheduled tasks for a specific agent. Shows when the agent is configured to run automatically.
350
+
351
+ #### Parameters
352
+
353
+ | Name | Type | Required | Description |
354
+ |------|------|----------|-------------|
355
+ | `agentId` | number | Yes | The unique ID of the agent. |
356
+
357
+ #### Returns
358
+
359
+ Array of schedules with `id`, `name`, `cronExpression`/`schedule`, `nextRunTime`, `isEnabled`, `timezone`.
360
+
361
+ #### Example Prompts
362
+
363
+ ```
364
+ When does agent 123 run?
365
+ Show schedules for the Amazon scraper
366
+ Is this agent scheduled?
367
+ ```
368
+
369
+ ---
370
+
371
+ ### create_agent_schedule
372
+
373
+ Create a schedule for an agent. Three schedule types are supported:
374
+
375
+ | Type | Value | Description |
376
+ |------|-------|-------------|
377
+ | RunOnce | 1 | Run once at a specific time. Requires `startTime`. |
378
+ | RunEvery | 2 | Run at regular intervals. Requires `runEveryCount` and `runEveryPeriod`. |
379
+ | CRON | 3 | Run based on cron expression. Requires `cronExpression`. |
380
+
381
+ #### Parameters
382
+
383
+ | Name | Type | Required | Description |
384
+ |------|------|----------|-------------|
385
+ | `agentId` | number | Yes | Agent ID to schedule. |
386
+ | `name` | string | Yes | Schedule name. |
387
+ | `scheduleType` | number | No | 1=RunOnce, 2=RunEvery, 3=CRON. Default: 3. |
388
+ | `startTime` | string | Conditional | ISO 8601 UTC datetime. Required for RunOnce (must be ≥1min in future). Optional for RunEvery. |
389
+ | `cronExpression` | string | Conditional | For CRON: `'min hr day mo wkday'`. Example: `'0 9 * * 1,4'` = Mon/Thu 9am. |
390
+ | `runEveryCount` | number | Conditional | For RunEvery: interval count. |
391
+ | `runEveryPeriod` | number | Conditional | For RunEvery: 0=min, 1=hr, 2=day, 3=wk, 4=mo. |
392
+ | `timezone` | string | No | Timezone (e.g., `'America/New_York'`). Default: UTC. |
393
+ | `inputParameters` | string | No | JSON input parameters for runs. |
394
+ | `isEnabled` | boolean | No | Whether schedule is active. Default: `true`. |
395
+ | `parallelism` | number | No | Parallel instances. Default: 1. |
396
+
397
+ #### Returns
398
+
399
+ Created schedule details with `id`, `nextRunTime`, and configuration.
400
+
401
+ #### Example Prompts
402
+
403
+ ```
404
+ Schedule agent 123 to run every Monday at 9am
405
+ Create a daily schedule for the price scraper
406
+ Run agent 456 every 6 hours
407
+ ```
408
+
409
+ ---
410
+
411
+ ### delete_agent_schedule
412
+
413
+ Remove a schedule from an agent. The agent will no longer run automatically on this schedule.
414
+
415
+ **Warning**: This permanently deletes the schedule.
416
+
417
+ #### Parameters
418
+
419
+ | Name | Type | Required | Description |
420
+ |------|------|----------|-------------|
421
+ | `agentId` | number | Yes | The unique ID of the agent. |
422
+ | `scheduleId` | number | Yes | The schedule ID to delete. Get this from `list_agent_schedules`. |
423
+
424
+ #### Returns
425
+
426
+ Confirmation that the schedule was deleted.
427
+
428
+ #### Example Prompts
429
+
430
+ ```
431
+ Stop the scheduled runs for agent 123
432
+ Remove the Monday schedule
433
+ Delete schedule 456
434
+ ```
435
+
436
+ ---
437
+
438
+ ### get_scheduled_runs
439
+
440
+ Get all upcoming scheduled runs across all agents in a date range. Shows what will run and when.
441
+
442
+ #### Parameters
443
+
444
+ | Name | Type | Required | Description |
445
+ |------|------|----------|-------------|
446
+ | `startDate` | string | No | Start date in ISO 8601 format. Example: `'2026-01-16'`. Defaults to today. |
447
+ | `endDate` | string | No | End date in ISO 8601 format. Defaults to 7 days from start. |
448
+
449
+ #### Returns
450
+
451
+ Array of upcoming runs with `scheduleId`, `agentId`, `agentName`, `scheduleName`, `nextRunTime`, `isEnabled`.
452
+
453
+ #### Example Prompts
454
+
455
+ ```
456
+ What runs this week?
457
+ Show upcoming schedules
458
+ What agents are scheduled tomorrow?
459
+ ```
460
+
461
+ ---
462
+
463
+ ## Billing & Credits
464
+
465
+ ### get_credits_balance
466
+
467
+ Get the current available credits balance for the organization.
468
+
469
+ #### Parameters
470
+
471
+ None.
472
+
473
+ #### Returns
474
+
475
+ `availableCredits`, `organizationId`, `retrievedAt` timestamp.
476
+
477
+ #### Example Prompts
478
+
479
+ ```
480
+ How many credits do I have?
481
+ What's my balance?
482
+ Check credits
483
+ ```
484
+
485
+ ---
486
+
487
+ ### get_spending_summary
488
+
489
+ Get a summary of credits spent in a date range.
490
+
491
+ #### Parameters
492
+
493
+ | Name | Type | Required | Description |
494
+ |------|------|----------|-------------|
495
+ | `startDate` | string | No | Start date in ISO 8601 format. Example: `'2026-01-01'`. |
496
+ | `endDate` | string | No | End date in ISO 8601 format. Example: `'2026-01-31'`. |
497
+
498
+ #### Returns
499
+
500
+ `totalSpent`, `startDate`, `endDate`, `currentBalance`.
501
+
502
+ #### Example Prompts
503
+
504
+ ```
505
+ How much have I spent?
506
+ What's my usage this week?
507
+ Show spending for January
508
+ ```
509
+
510
+ ---
511
+
512
+ ### get_credit_history
513
+
514
+ Get the transaction history of credits (additions from purchases, deductions from usage).
515
+
516
+ #### Parameters
517
+
518
+ | Name | Type | Required | Description |
519
+ |------|------|----------|-------------|
520
+ | `pageIndex` | number | No | Page number (1-based). Default: 1. |
521
+ | `recordsPerPage` | number | No | Records per page. Default: 50, Max: 100. |
522
+
523
+ #### Returns
524
+
525
+ Array of transactions with `transactionType`, `amount`, `balance`, `created` date, `message`.
526
+
527
+ #### Example Prompts
528
+
529
+ ```
530
+ Show credit history
531
+ What were my credit transactions?
532
+ When were credits added?
533
+ ```
534
+
535
+ ---
536
+
537
+ ## Space Management
538
+
539
+ ### list_spaces
540
+
541
+ List all accessible spaces (folders for organizing agents into groups).
542
+
543
+ #### Parameters
544
+
545
+ None.
546
+
547
+ #### Returns
548
+
549
+ Array of spaces with `id`, `name`, `description`.
550
+
551
+ #### Example Prompts
552
+
553
+ ```
554
+ What spaces do I have?
555
+ Show my folders
556
+ List agent groups
557
+ ```
558
+
559
+ ---
560
+
561
+ ### get_space
562
+
563
+ Get details of a specific space including its description and settings.
564
+
565
+ #### Parameters
566
+
567
+ | Name | Type | Required | Description |
568
+ |------|------|----------|-------------|
569
+ | `spaceId` | number | Yes | The unique ID of the space. Get this from `list_spaces`. |
570
+
571
+ #### Returns
572
+
573
+ Space details with `id`, `name`, `description`, `organizationId`, `created`/`updated` dates.
574
+
575
+ #### Example Prompts
576
+
577
+ ```
578
+ Tell me about space 123
579
+ Show space details
580
+ ```
581
+
582
+ ---
583
+
584
+ ### get_space_agents
585
+
586
+ List all agents that belong to a specific space.
587
+
588
+ #### Parameters
589
+
590
+ | Name | Type | Required | Description |
591
+ |------|------|----------|-------------|
592
+ | `spaceId` | number | Yes | The unique ID of the space. Get this from `list_spaces` or `search_space_by_name`. |
593
+
594
+ #### Returns
595
+
596
+ Array of agents in the space with `id`, `name`, `status`, `configType`, `lastActivity`.
597
+
598
+ #### Example Prompts
599
+
600
+ ```
601
+ What agents are in space 123?
602
+ Show agents in the Production folder
603
+ List scrapers in the Bot Blocking space
604
+ ```
605
+
606
+ ---
607
+
608
+ ### search_space_by_name
609
+
610
+ Find a space by its name. Use when user mentions a space by name instead of ID.
611
+
612
+ #### Parameters
613
+
614
+ | Name | Type | Required | Description |
615
+ |------|------|----------|-------------|
616
+ | `name` | string | Yes | The space name to search for. Case-insensitive. |
617
+
618
+ #### Returns
619
+
620
+ Matching space with `id`, `name`, `description`.
621
+
622
+ #### Example Prompts
623
+
624
+ ```
625
+ Find the Production space
626
+ Get the Bot Blocking folder
627
+ ```
628
+
629
+ ---
630
+
631
+ ### run_space_agents
632
+
633
+ Start all agents in a space at once (batch operation). Useful for running a group of related agents together.
634
+
635
+ **Warning**: This starts multiple agents. Use `get_space_agents` first to see what will run.
636
+
637
+ #### Parameters
638
+
639
+ | Name | Type | Required | Description |
640
+ |------|------|----------|-------------|
641
+ | `spaceId` | number | Yes | The unique ID of the space. Get this from `list_spaces` or `search_space_by_name`. |
642
+ | `inputParameters` | string | No | Optional JSON string of input parameters to pass to all agents in the space. |
643
+
644
+ #### Returns
645
+
646
+ Summary with `totalAgents`, `agentsStarted`, `agentsFailed`, and individual results.
647
+
648
+ #### Example Prompts
649
+
650
+ ```
651
+ Run all agents in space 123
652
+ Execute the Production folder
653
+ Start all scrapers in Bot Blocking
654
+ ```
655
+
656
+ ---
657
+
658
+ ## Analytics & Diagnostics
659
+
660
+ ### get_runs_summary
661
+
662
+ Get aggregate statistics about agent runs in a date range: counts of completed, failed, running, etc.
663
+
664
+ #### Parameters
665
+
666
+ | Name | Type | Required | Description |
667
+ |------|------|----------|-------------|
668
+ | `startDate` | string | No | Start date in ISO 8601 format. Defaults to today. |
669
+ | `endDate` | string | No | End date in ISO 8601 format. Defaults to today. |
670
+ | `status` | string | No | Filter by run status: `'Failed'`, `'Completed'`, `'CompletedWithErrors'`, `'Running'`. |
671
+ | `includeDetails` | boolean | No | If `true`, includes `failedRunDetails` array with agent names and error messages. Default: `true`. |
672
+
673
+ #### Returns
674
+
675
+ `totalRuns`, `completedRuns`, `failedRuns`, `completedWithErrorsRuns`, `runningRuns`, `queuedRuns`, `stoppedRuns`.
676
+
677
+ #### Example Prompts
678
+
679
+ ```
680
+ How many agents ran yesterday?
681
+ What failed last week?
682
+ Show run statistics for this month
683
+ ```
684
+
685
+ ---
686
+
687
+ ### get_records_summary
688
+
689
+ Get a summary of how many records were extracted and exported by agents in a date range.
690
+
691
+ #### Parameters
692
+
693
+ | Name | Type | Required | Description |
694
+ |------|------|----------|-------------|
695
+ | `startDate` | string | No | Start date in ISO 8601 format. |
696
+ | `endDate` | string | No | End date in ISO 8601 format. |
697
+ | `agentId` | number | No | Filter to show records for a specific agent only. |
698
+
699
+ #### Returns
700
+
701
+ `totalRecordsExtracted`, `totalRecordsExported`, `totalErrors`, `totalPageLoads`, `runCount`.
702
+
703
+ #### Example Prompts
704
+
705
+ ```
706
+ How many records were scraped?
707
+ What was the output yesterday?
708
+ Show extraction statistics for agent 123
709
+ ```
710
+
711
+ ---
712
+
713
+ ### get_run_diagnostics
714
+
715
+ Get detailed diagnostics for a specific run, including error messages, possible causes, and suggested fixes.
716
+
717
+ #### Parameters
718
+
719
+ | Name | Type | Required | Description |
720
+ |------|------|----------|-------------|
721
+ | `agentId` | number | Yes | The unique ID of the agent. |
722
+ | `runId` | number | Yes | The run ID to diagnose. Get this from `get_agent_runs`. |
723
+
724
+ #### Returns
725
+
726
+ `errorMessage`, `possibleCauses` (array), `suggestedActions` (array), run timing and stats.
727
+
728
+ #### Example Prompts
729
+
730
+ ```
731
+ Why did run 123 fail?
732
+ Show error details for this run
733
+ Debug run 456 for agent 789
734
+ ```
735
+
736
+ ---
737
+
738
+ ### get_latest_failure
739
+
740
+ Get diagnostics for the most recent failed run of an agent. Includes error analysis and suggested fixes.
741
+
742
+ This is a shortcut for calling `get_agent_runs`, filtering for failures, then calling `get_run_diagnostics`.
743
+
744
+ #### Parameters
745
+
746
+ | Name | Type | Required | Description |
747
+ |------|------|----------|-------------|
748
+ | `agentId` | number | Yes | The unique ID of the agent. Get this from `list_agents` or `search_agents`. |
749
+
750
+ #### Returns
751
+
752
+ `errorMessage`, `possibleCauses`, `suggestedActions`, run timing and stats.
753
+
754
+ #### Example Prompts
755
+
756
+ ```
757
+ Why did my agent fail?
758
+ What went wrong with agent 123?
759
+ Show the last error for the Amazon scraper
760
+ ```
761
+
762
+ ---
763
+
764
+ ## Appendix
765
+
766
+ ### Run Status Values
767
+
768
+ | Value | Status | Description |
769
+ |-------|--------|-------------|
770
+ | 0 | Invalid | Invalid or unknown state |
771
+ | 1 | Running | Currently executing |
772
+ | 2 | Exporting | Exporting data |
773
+ | 3 | Starting | Starting up |
774
+ | 4 | Queuing | Waiting in queue |
775
+ | 5 | Stopping | Shutting down |
776
+ | 6 | Failure | Failed during execution |
777
+ | 7 | Failed | Completed with failure |
778
+ | 8 | Stopped | Manually stopped |
779
+ | 9 | Completed | Finished successfully |
780
+ | 10 | Success | Completed without errors |
781
+ | 11 | Skipped | Skipped execution |
782
+ | 12 | Waiting | Waiting for resources |