sequentum-mcp 1.1.4 → 1.2.2

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +104 -3
  3. package/dist/{api-client.d.ts → api/api-client.d.ts} +106 -4
  4. package/dist/api/api-client.d.ts.map +1 -0
  5. package/dist/{api-client.js → api/api-client.js} +345 -99
  6. package/dist/api/api-client.js.map +1 -0
  7. package/dist/{types.d.ts → api/types.d.ts} +122 -12
  8. package/dist/api/types.d.ts.map +1 -0
  9. package/dist/{types.js → api/types.js} +57 -0
  10. package/dist/api/types.js.map +1 -0
  11. package/dist/index.js +11 -1737
  12. package/dist/index.js.map +1 -1
  13. package/dist/server/cors.d.ts +33 -0
  14. package/dist/server/cors.d.ts.map +1 -0
  15. package/dist/server/cors.js +72 -0
  16. package/dist/server/cors.js.map +1 -0
  17. package/dist/server/handlers.d.ts +49 -0
  18. package/dist/server/handlers.d.ts.map +1 -0
  19. package/dist/server/handlers.js +1031 -0
  20. package/dist/server/handlers.js.map +1 -0
  21. package/dist/server/http-server.d.ts +13 -0
  22. package/dist/server/http-server.d.ts.map +1 -0
  23. package/dist/server/http-server.js +393 -0
  24. package/dist/server/http-server.js.map +1 -0
  25. package/dist/server/policies.d.ts +19 -0
  26. package/dist/server/policies.d.ts.map +1 -0
  27. package/dist/server/policies.js +32 -0
  28. package/dist/server/policies.js.map +1 -0
  29. package/dist/server/prompts.d.ts +19 -0
  30. package/dist/server/prompts.d.ts.map +1 -0
  31. package/dist/server/prompts.js +464 -0
  32. package/dist/server/prompts.js.map +1 -0
  33. package/dist/server/resources.d.ts +26 -0
  34. package/dist/server/resources.d.ts.map +1 -0
  35. package/dist/server/resources.js +348 -0
  36. package/dist/server/resources.js.map +1 -0
  37. package/dist/server/tools.d.ts +9 -0
  38. package/dist/server/tools.d.ts.map +1 -0
  39. package/dist/server/tools.js +977 -0
  40. package/dist/server/tools.js.map +1 -0
  41. package/dist/utils/oauth-metadata.d.ts.map +1 -0
  42. package/dist/utils/oauth-metadata.js.map +1 -0
  43. package/dist/{validation.d.ts → utils/validation.d.ts} +25 -2
  44. package/dist/utils/validation.d.ts.map +1 -0
  45. package/dist/{validation.js → utils/validation.js} +43 -3
  46. package/dist/utils/validation.js.map +1 -0
  47. package/docs/prompts-reference.md +370 -0
  48. package/docs/resources-reference.md +300 -0
  49. package/docs/tool-reference.md +244 -2
  50. package/package.json +4 -3
  51. package/dist/api-client.d.ts.map +0 -1
  52. package/dist/api-client.js.map +0 -1
  53. package/dist/oauth-metadata.d.ts.map +0 -1
  54. package/dist/oauth-metadata.js.map +0 -1
  55. package/dist/types.d.ts.map +0 -1
  56. package/dist/types.js.map +0 -1
  57. package/dist/validation.d.ts.map +0 -1
  58. package/dist/validation.js.map +0 -1
  59. /package/dist/{oauth-metadata.d.ts → utils/oauth-metadata.d.ts} +0 -0
  60. /package/dist/{oauth-metadata.js → utils/oauth-metadata.js} +0 -0
@@ -0,0 +1,977 @@
1
+ /**
2
+ * MCP Tool Definitions
3
+ *
4
+ * Contains all tool schemas exposed by the Sequentum MCP server.
5
+ * Each tool describes its name, description, inputSchema, and annotations.
6
+ */
7
+ import { PROMPT_HANDLING_POLICY } from "./policies.js";
8
+ export const tools = [
9
+ // Agent Tools
10
+ {
11
+ name: "list_agents",
12
+ description: "List web scraping agents with IDs, names, status, and configuration. " +
13
+ "USE THIS FIRST to discover available agents before running or managing them. " +
14
+ "Answers: 'What agents do I have?', 'Show me my scrapers', 'List all completed agents'. " +
15
+ "Returns: Array of agent summaries with id, name, status (last run status), configType, version, lastActivity. " +
16
+ "Pagination always applied (defaults: pageIndex=1, recordsPerPage=50). " +
17
+ "TIP: Use 'search' param to find agents by name, or 'status' to filter by last run status (Completed, Failed, etc.).",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ status: {
22
+ type: "number",
23
+ enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
24
+ description: "Filter by last run status: 0=Invalid, 1=Running, 2=Exporting, 3=Starting, 4=Queuing, 5=Stopping, 6=Failure, 7=Failed, 8=Stopped, 9=Completed, 10=Success, 11=Skipped, 12=Waiting. Agents that never ran have null status.",
25
+ },
26
+ spaceId: {
27
+ type: "number",
28
+ description: "Filter by space ID. Use list_spaces first to find space IDs.",
29
+ },
30
+ search: {
31
+ type: "string",
32
+ description: "Search by agent name (case-insensitive partial match). Example: 'amazon' finds 'Amazon Product Scraper'.",
33
+ },
34
+ configType: {
35
+ type: "string",
36
+ enum: ["Agent", "Command", "Api", "Shared"],
37
+ description: "Filter by type. 'Agent' = web scrapers, 'Command' = data inputs, 'Api' = API configs, 'Shared' = reusable components.",
38
+ },
39
+ sortColumn: {
40
+ type: "string",
41
+ enum: ["name", "lastActivity", "created", "updated", "status", "configType"],
42
+ description: "Column to sort by. 'lastActivity' shows recently run agents first (with sortOrder=1).",
43
+ },
44
+ sortOrder: {
45
+ type: "string",
46
+ enum: ["asc", "desc"],
47
+ description: "Sort direction. 'desc' = newest/Z first (descending), 'asc' = oldest/A first (ascending, default).",
48
+ },
49
+ pageIndex: {
50
+ type: "number",
51
+ description: "Page number (1-based). Defaults to 1. Use with recordsPerPage to paginate large result sets.",
52
+ },
53
+ recordsPerPage: {
54
+ type: "number",
55
+ description: "Results per page. Defaults to 50. Max recommended: 100.",
56
+ },
57
+ },
58
+ required: [],
59
+ },
60
+ annotations: {
61
+ title: "List Agents",
62
+ readOnlyHint: true,
63
+ },
64
+ },
65
+ {
66
+ name: "get_agent",
67
+ description: "Get detailed information about a specific agent including its configuration, input parameters, and documentation. " +
68
+ "USE AFTER list_agents or search_agents when you need full details for a specific agent. " +
69
+ "Answers: 'Tell me about agent X', 'What parameters does this agent need?', 'Show agent configuration'. " +
70
+ "Returns: Full agent details including inputParameters (what inputs the agent accepts), description, documentation, startUrl. " +
71
+ "REQUIRED: You must have the agentId first (get it from list_agents, search_agents, or get_agent_build_status when building a new agent).",
72
+ inputSchema: {
73
+ type: "object",
74
+ properties: {
75
+ agentId: { type: "number", description: "The unique ID of the agent. Get this from list_agents, search_agents, or get_agent_build_status (when building a new agent)." },
76
+ },
77
+ required: ["agentId"],
78
+ },
79
+ annotations: {
80
+ title: "Get Agent",
81
+ readOnlyHint: true,
82
+ },
83
+ },
84
+ {
85
+ name: "search_agents",
86
+ description: "Search for agents by name or description (case-insensitive partial match). " +
87
+ "FASTER than list_agents when user mentions a specific agent name. " +
88
+ "Answers: 'Find the Amazon scraper', 'Which agent handles product data?', 'Search for pricing agents'. " +
89
+ "Returns: Matching agents with id, name, status, configType. " +
90
+ "TIP: Prefer this over list_agents when user mentions an agent by name.",
91
+ inputSchema: {
92
+ type: "object",
93
+ properties: {
94
+ query: { type: "string", description: "Search term to match against agent names and descriptions. Case-insensitive." },
95
+ maxRecords: { type: "number", description: "Maximum results to return. Default: 50, Max: 1000." },
96
+ },
97
+ required: ["query"],
98
+ },
99
+ annotations: {
100
+ title: "Search Agents",
101
+ readOnlyHint: true,
102
+ },
103
+ },
104
+ // Run Tools
105
+ {
106
+ name: "get_agent_runs",
107
+ description: "Get execution history for an agent showing past runs with status, timing, and records extracted. " +
108
+ "Answers: 'When did agent X last run?', 'Show run history', 'How many records were extracted?', 'Did the agent fail?'. " +
109
+ "Returns: Array of runs with id, status (Running/Completed/Failed/etc), startTime, endTime, recordsExtracted, recordsExported, errorMessage. " +
110
+ "TIP: Check the most recent run's status to see if agent is currently running or recently completed. " +
111
+ "NEXT STEP: Use get_run_files to see output files from a completed run.",
112
+ inputSchema: {
113
+ type: "object",
114
+ properties: {
115
+ agentId: { type: "number", description: "The unique ID of the agent. Get this from list_agents, search_agents, or get_agent_build_status (when building a new agent)." },
116
+ maxRecords: { type: "number", description: "Maximum number of runs to return. Default: 50. Use smaller values for faster response." },
117
+ },
118
+ required: ["agentId"],
119
+ },
120
+ annotations: {
121
+ title: "Get Agent Runs",
122
+ readOnlyHint: true,
123
+ },
124
+ },
125
+ {
126
+ name: "get_run_status",
127
+ description: "Get the current status of a specific run. FASTER than get_agent_runs when you only need one run's status. " +
128
+ "Answers: 'Is run 123 still running?', 'Did that run complete?', 'Check run status'. " +
129
+ "Returns: Single run with status, timing, records extracted. " +
130
+ "USE AFTER start_agent to monitor a run you just started. " +
131
+ "Status values: Running, Completed, Failed, CompletedWithErrors, Stopped, Queued.",
132
+ inputSchema: {
133
+ type: "object",
134
+ properties: {
135
+ agentId: { type: "number", description: "The unique ID of the agent." },
136
+ runId: { type: "number", description: "The run ID returned by start_agent or found in get_agent_runs." },
137
+ },
138
+ required: ["agentId", "runId"],
139
+ },
140
+ annotations: {
141
+ title: "Get Run Status",
142
+ readOnlyHint: true,
143
+ },
144
+ },
145
+ {
146
+ name: "start_agent",
147
+ description: "Start a web scraping agent execution. Two modes available: " +
148
+ "(1) ASYNC (default): Returns immediately with runId - use get_run_status to monitor progress. " +
149
+ "(2) SYNC: Set isRunSynchronously=true to wait and get scraped data directly (best for quick agents <60s). " +
150
+ "Answers: 'Run agent X', 'Start the scraper', 'Execute the Amazon agent', 'Scrape this website'. " +
151
+ "Returns: In async mode: {runId, status}. In sync mode: Scraped data directly as JSON/text. " +
152
+ "REQUIRED: Get agentId first using list_agents, search_agents, or get_agent_build_status (when building a new agent). " +
153
+ "TIP: Use get_agent first to check what inputParameters the agent accepts before running.",
154
+ inputSchema: {
155
+ type: "object",
156
+ properties: {
157
+ agentId: { type: "number", description: "The unique ID of the agent to run. Get this from list_agents, search_agents, or get_agent_build_status (when building a new agent)." },
158
+ inputParameters: { type: "string", description: "JSON string of input parameters. Check agent's inputParameters with get_agent to see what's accepted. Example: '{\"url\": \"https://example.com\"}'" },
159
+ isRunSynchronously: { type: "boolean", description: "If true, wait for completion and return scraped data. If false (default), return immediately with runId. Use true only for quick agents." },
160
+ timeout: { type: "number", description: "Timeout in seconds for synchronous runs. Only used when isRunSynchronously=true. Default: 60." },
161
+ parallelism: { type: "number", description: "Number of parallel instances. Default: 1. Cannot be >1 when isRunSynchronously=true." },
162
+ },
163
+ required: ["agentId"],
164
+ },
165
+ annotations: {
166
+ title: "Start Agent",
167
+ readOnlyHint: false,
168
+ destructiveHint: false,
169
+ // Runs a scraping agent against an arbitrary user-supplied URL — open-world by definition.
170
+ openWorldHint: true,
171
+ },
172
+ },
173
+ {
174
+ name: "stop_agent",
175
+ description: "Stop a running agent execution immediately. Use to cancel runs that are taking too long or no longer needed. " +
176
+ "Answers: 'Stop that run', 'Cancel the scraper', 'Abort agent X', 'Kill the running job'. " +
177
+ "REQUIRED: You need both agentId and runId. Get runId from start_agent response or get_agent_runs.",
178
+ inputSchema: {
179
+ type: "object",
180
+ properties: {
181
+ agentId: { type: "number", description: "The unique ID of the agent." },
182
+ runId: { type: "number", description: "The run ID to stop. Get this from start_agent response or get_agent_runs." },
183
+ },
184
+ required: ["agentId", "runId"],
185
+ },
186
+ annotations: {
187
+ title: "Stop Agent",
188
+ readOnlyHint: false,
189
+ destructiveHint: false,
190
+ openWorldHint: false,
191
+ },
192
+ },
193
+ {
194
+ name: "kill_agent",
195
+ description: "Force-terminate an agent when stop_agent is not working. " +
196
+ "BEHAVIOR: First call initiates graceful stop (same as stop_agent). Second call forces immediate process termination if still stopping. " +
197
+ "USE WHEN: stop_agent was called but agent is still running/stopping and not responding. " +
198
+ "Answers: 'Force kill stuck agent', 'Agent won't stop', 'Terminate unresponsive run'. " +
199
+ "REQUIRED: agentId and runId. Get runId from start_agent or get_agent_runs. " +
200
+ "WARNING: This is a destructive operation that can forcefully terminate server processes.",
201
+ inputSchema: {
202
+ type: "object",
203
+ properties: {
204
+ agentId: { type: "number", description: "The unique ID of the agent." },
205
+ runId: { type: "number", description: "The run ID to kill. Get from start_agent or get_agent_runs." },
206
+ },
207
+ required: ["agentId", "runId"],
208
+ },
209
+ annotations: {
210
+ title: "Kill Agent",
211
+ readOnlyHint: false,
212
+ destructiveHint: true,
213
+ openWorldHint: false,
214
+ },
215
+ },
216
+ // Destructive Operations
217
+ {
218
+ name: "delete_run",
219
+ description: "Delete a run and its associated data (files, storage). Used for PII compliance. " +
220
+ "Checks both active Runs and RunHistory tables automatically. " +
221
+ "Answers: 'Delete run X', 'Remove run files', 'Clean up PII data from a run'. " +
222
+ "WARNING: Destructive and irreversible. " +
223
+ "REQUIRED: agentId and runId. Get runId from get_agent_runs.",
224
+ inputSchema: {
225
+ type: "object",
226
+ properties: {
227
+ agentId: { type: "number", description: "The ID of the agent that contains the run." },
228
+ runId: { type: "number", description: "The ID of the run to delete. Get from get_agent_runs." },
229
+ removeMethod: {
230
+ type: "string",
231
+ enum: ["RemoveEntireRun", "RemoveAllFiles", "RemoveAllFilesAndAgentInput"],
232
+ description: "What to delete. " +
233
+ "RemoveEntireRun (default): Completely removes the run record and all associated files. " +
234
+ "RemoveAllFiles: Removes files but keeps the run record. " +
235
+ "RemoveAllFilesAndAgentInput: Removes files and clears agent input parameters.",
236
+ },
237
+ },
238
+ required: ["agentId", "runId"],
239
+ },
240
+ annotations: {
241
+ title: "Delete Run",
242
+ readOnlyHint: false,
243
+ destructiveHint: true,
244
+ openWorldHint: false,
245
+ },
246
+ },
247
+ // File Tools
248
+ {
249
+ name: "get_run_files",
250
+ description: "List all output files generated by a completed run. Files contain scraped data in formats like CSV, JSON, Excel. " +
251
+ "Answers: 'What files did the run produce?', 'Show output files', 'Where is the scraped data?', 'Download results'. " +
252
+ "Returns: Array of files with id, name, fileType, fileSize, created. " +
253
+ "USE AFTER a run completes (status=Completed) to see available downloads. " +
254
+ "NEXT STEP: Use get_file_download_url with a fileId to get the actual download link.",
255
+ inputSchema: {
256
+ type: "object",
257
+ properties: {
258
+ agentId: { type: "number", description: "The unique ID of the agent." },
259
+ runId: { type: "number", description: "The run ID. Get this from get_agent_runs or start_agent response." },
260
+ },
261
+ required: ["agentId", "runId"],
262
+ },
263
+ annotations: {
264
+ title: "Get Run Files",
265
+ readOnlyHint: true,
266
+ },
267
+ },
268
+ {
269
+ name: "get_file_download_url",
270
+ description: "Get a temporary download URL for a specific output file. The URL expires after a short time. " +
271
+ "Answers: 'Download the CSV file', 'Get the output data', 'Give me the file link'. " +
272
+ "Returns: Temporary URL that can be used to download the file directly. " +
273
+ "REQUIRED: Get fileId first from get_run_files. " +
274
+ "TIP: Share the URL with the user so they can download the file.",
275
+ inputSchema: {
276
+ type: "object",
277
+ properties: {
278
+ agentId: { type: "number", description: "The unique ID of the agent." },
279
+ runId: { type: "number", description: "The run ID." },
280
+ fileId: { type: "number", description: "The file ID from get_run_files response." },
281
+ },
282
+ required: ["agentId", "runId", "fileId"],
283
+ },
284
+ annotations: {
285
+ title: "Get File Download URL",
286
+ readOnlyHint: true,
287
+ },
288
+ },
289
+ // Version Tools
290
+ {
291
+ name: "get_agent_versions",
292
+ description: "List all saved versions of an agent's configuration. Use for reviewing change history or finding a version to restore. " +
293
+ "Answers: 'Show agent version history', 'What changes were made?', 'List previous versions'. " +
294
+ "Returns: Array of versions with version number, userName (who made the change), created date, comments, fileSize. " +
295
+ "NEXT STEP: Use restore_agent_version to roll back to a previous version if needed.",
296
+ inputSchema: {
297
+ type: "object",
298
+ properties: {
299
+ agentId: { type: "number", description: "The unique ID of the agent." },
300
+ },
301
+ required: ["agentId"],
302
+ },
303
+ annotations: {
304
+ title: "Get Agent Versions",
305
+ readOnlyHint: true,
306
+ },
307
+ },
308
+ {
309
+ name: "restore_agent_version",
310
+ description: "Restore an agent to a previous version. This creates a NEW version based on the restored configuration. " +
311
+ "Answers: 'Roll back agent to version X', 'Undo agent changes', 'Restore previous configuration'. " +
312
+ "WARNING: This modifies the agent. Use get_agent_versions first to find the correct version number. " +
313
+ "REQUIRED: Provide a reason in 'comments' explaining why the restore is needed.",
314
+ inputSchema: {
315
+ type: "object",
316
+ properties: {
317
+ agentId: { type: "number", description: "The unique ID of the agent." },
318
+ versionNumber: { type: "number", description: "The version number to restore to. Get this from get_agent_versions." },
319
+ comments: { type: "string", description: "Explanation for why this version is being restored. Will be recorded in version history." },
320
+ },
321
+ required: ["agentId", "versionNumber", "comments"],
322
+ },
323
+ annotations: {
324
+ title: "Restore Agent Version",
325
+ readOnlyHint: false,
326
+ destructiveHint: false,
327
+ openWorldHint: false,
328
+ },
329
+ },
330
+ // Schedule Tools
331
+ {
332
+ name: "list_agent_schedules",
333
+ description: "List all scheduled tasks for a specific agent. Shows when the agent is configured to run automatically. " +
334
+ "Answers: 'When does this agent run?', 'Show schedules for agent X', 'Is this agent scheduled?'. " +
335
+ "Returns: Array of schedules with id, name, cronExpression/schedule, nextRunTime, isEnabled, timezone. " +
336
+ "TIP: Check isEnabled to see if the schedule is active.",
337
+ inputSchema: {
338
+ type: "object",
339
+ properties: {
340
+ agentId: { type: "number", description: "The unique ID of the agent." },
341
+ },
342
+ required: ["agentId"],
343
+ },
344
+ annotations: {
345
+ title: "List Agent Schedules",
346
+ readOnlyHint: true,
347
+ },
348
+ },
349
+ {
350
+ name: "create_agent_schedule",
351
+ description: "Create a scheduled task to automatically run an agent. " +
352
+ "Three schedule types available: " +
353
+ "RunOnce (1): Runs once at startTime (required, must be >=1 min in future UTC). " +
354
+ "RunEvery (2): Repeats every runEveryCount periods (runEveryPeriod: 1=min, 2=hr, 3=day, 4=wk, 5=mo). Optional startTime for first run (must be in future if provided). " +
355
+ "CRON (3): Uses cronExpression for complex schedules (e.g., '0 9 * * 1,4' = Mon/Thu 9am). " +
356
+ "Always specify timezone for local time interpretation. " +
357
+ "Examples: CRON daily at 9am: {scheduleType:3, cronExpression:'0 9 * * *'}. " +
358
+ "RunOnce: {scheduleType:1, startTime:'2026-01-20T14:30:00Z'}. " +
359
+ "RunEvery 30min: {scheduleType:2, runEveryCount:30, runEveryPeriod:1}.",
360
+ inputSchema: {
361
+ type: "object",
362
+ properties: {
363
+ agentId: { type: "number", description: "The unique ID of the agent to schedule. Get this from list_agents, search_agents, or get_agent_build_status (when building a new agent)." },
364
+ name: { type: "string", description: "A descriptive name for the schedule (e.g., 'Daily Morning Run')." },
365
+ scheduleType: {
366
+ type: "number",
367
+ enum: [1, 2, 3],
368
+ description: "Schedule type: 1=RunOnce (single execution), 2=RunEvery (recurring interval), 3=CRON (cron expression). Default: 3 (CRON)."
369
+ },
370
+ startTime: {
371
+ type: "string",
372
+ description: "ISO 8601 UTC datetime (e.g., '2026-01-20T14:30:00Z'). Required for RunOnce (must be >=1 min in future). Optional for RunEvery (sets first run time, must be in future). Not used for CRON."
373
+ },
374
+ cronExpression: {
375
+ type: "string",
376
+ description: "CRON expression for scheduleType=3. Format: 'minute hour day month weekday'. Examples: '0 9 * * *' (daily 9am), '0 9 * * 1,4' (Mon/Thu 9am), '*/30 * * * *' (every 30 min)."
377
+ },
378
+ runEveryCount: {
379
+ type: "number",
380
+ description: "For scheduleType=2 (RunEvery): The interval count. Example: 30 with runEveryPeriod=1 means every 30 minutes."
381
+ },
382
+ runEveryPeriod: {
383
+ type: "number",
384
+ enum: [1, 2, 3, 4, 5],
385
+ description: "For scheduleType=2 (RunEvery): The time unit. 1=minutes, 2=hours, 3=days, 4=weeks, 5=months."
386
+ },
387
+ timezone: {
388
+ type: "string",
389
+ description: "Timezone for schedule interpretation (e.g., 'America/New_York', 'America/Denver', 'Europe/London'). Default: UTC."
390
+ },
391
+ inputParameters: { type: "string", description: "Optional JSON string of input parameters to pass to each scheduled run." },
392
+ isEnabled: { type: "boolean", description: "Whether the schedule is active. Default: true." },
393
+ parallelism: { type: "number", description: "Number of parallel instances to run. Default: 1." },
394
+ parallelMaxConcurrency: { type: "number", description: "Maximum concurrent parallel instances. Only relevant when parallelism > 1." },
395
+ parallelExport: {
396
+ type: "string",
397
+ enum: ["Combined", "Separated"],
398
+ description: "How parallel run exports are handled. 'Combined' merges output, 'Separated' keeps per-instance files.",
399
+ },
400
+ logLevel: {
401
+ type: "string",
402
+ enum: ["Fatal", "Error", "Warning", "Info"],
403
+ description: "Log verbosity for scheduled runs. Default: 'Info'.",
404
+ },
405
+ logMode: {
406
+ type: "string",
407
+ enum: ["Text", "TextAndHtml"],
408
+ description: "Log format. 'Text' for plain text, 'TextAndHtml' for both. Default: 'Text'.",
409
+ },
410
+ isExclusive: { type: "boolean", description: "If true, prevents concurrent runs of this agent. Default: false." },
411
+ isWaitOnFailure: { type: "boolean", description: "If true, waits before retrying after a failure. Default: false." },
412
+ // NOTE: proxyPoolId and serverGroupId are intentionally omitted from the MCP tool.
413
+ // The API supports them, but users have no way to discover valid IDs through the MCP
414
+ // (no list-proxy-pools or list-server-groups endpoints exist). Users needing these
415
+ // should configure them via the Sequentum dashboard.
416
+ // localSchedule is also omitted — it's a human-readable string generated server-side.
417
+ },
418
+ required: ["agentId", "name"],
419
+ },
420
+ annotations: {
421
+ title: "Create Agent Schedule",
422
+ readOnlyHint: false,
423
+ destructiveHint: false,
424
+ openWorldHint: false,
425
+ },
426
+ },
427
+ {
428
+ name: "delete_agent_schedule",
429
+ description: "Remove a schedule from an agent. The agent will no longer run automatically on this schedule. " +
430
+ "Answers: 'Stop the scheduled runs', 'Remove the Monday schedule', 'Delete schedule X'. " +
431
+ "WARNING: This permanently deletes the schedule. Use list_agent_schedules first to find the scheduleId.",
432
+ inputSchema: {
433
+ type: "object",
434
+ properties: {
435
+ agentId: { type: "number", description: "The unique ID of the agent." },
436
+ scheduleId: { type: "number", description: "The schedule ID to delete. Get this from list_agent_schedules." },
437
+ },
438
+ required: ["agentId", "scheduleId"],
439
+ },
440
+ annotations: {
441
+ title: "Delete Agent Schedule",
442
+ readOnlyHint: false,
443
+ destructiveHint: true,
444
+ openWorldHint: false,
445
+ },
446
+ },
447
+ {
448
+ name: "get_agent_schedule",
449
+ description: "Get details of a specific schedule for an agent. " +
450
+ "Answers: 'Show me schedule X details', 'What are the settings for this schedule?'. " +
451
+ "Returns: Full schedule details including name, cronExpression, nextRunTime, isEnabled, timezone, and run parameters.",
452
+ inputSchema: {
453
+ type: "object",
454
+ properties: {
455
+ agentId: { type: "number", description: "The unique ID of the agent." },
456
+ scheduleId: { type: "number", description: "The schedule ID. Get this from list_agent_schedules." },
457
+ },
458
+ required: ["agentId", "scheduleId"],
459
+ },
460
+ annotations: {
461
+ title: "Get Agent Schedule",
462
+ readOnlyHint: true,
463
+ },
464
+ },
465
+ {
466
+ name: "update_agent_schedule",
467
+ description: "Update an existing schedule for an agent. Modify timing, parameters, or other settings. " +
468
+ "Answers: 'Change the schedule to run at 10am', 'Update the cron expression', 'Modify the schedule timezone'. " +
469
+ "Three schedule types: RunOnce (1), RunEvery (2), CRON (3). " +
470
+ "TIP: Use get_agent_schedule or list_agent_schedules first to see current settings before updating.",
471
+ inputSchema: {
472
+ type: "object",
473
+ properties: {
474
+ agentId: { type: "number", description: "The unique ID of the agent." },
475
+ scheduleId: { type: "number", description: "The schedule ID to update. Get this from list_agent_schedules." },
476
+ name: { type: "string", description: "A descriptive name for the schedule." },
477
+ scheduleType: {
478
+ type: "number",
479
+ enum: [1, 2, 3],
480
+ description: "Schedule type: 1=RunOnce (single execution), 2=RunEvery (recurring interval), 3=CRON (cron expression)."
481
+ },
482
+ startTime: {
483
+ type: "string",
484
+ description: "Start time in ISO 8601 UTC format (e.g., '2026-01-20T14:30:00Z'). Required for RunOnce, optional for RunEvery."
485
+ },
486
+ cronExpression: {
487
+ type: "string",
488
+ description: "CRON expression for scheduleType=3. Format: 'minute hour day month weekday'. Examples: '0 9 * * *' (daily 9am), '0 9 * * 1,4' (Mon/Thu 9am)."
489
+ },
490
+ runEveryCount: {
491
+ type: "number",
492
+ description: "For scheduleType=2 (RunEvery): The interval count. Example: 30 with runEveryPeriod=1 means every 30 minutes."
493
+ },
494
+ runEveryPeriod: {
495
+ type: "number",
496
+ enum: [1, 2, 3, 4, 5],
497
+ description: "For scheduleType=2 (RunEvery): The time unit. 1=minutes, 2=hours, 3=days, 4=weeks, 5=months."
498
+ },
499
+ timezone: {
500
+ type: "string",
501
+ description: "Timezone for schedule interpretation (e.g., 'America/New_York', 'Europe/London')."
502
+ },
503
+ inputParameters: { type: "string", description: "Optional JSON string of input parameters to pass to each scheduled run." },
504
+ isEnabled: { type: "boolean", description: "Whether the schedule is active." },
505
+ parallelism: { type: "number", description: "Number of parallel instances to run." },
506
+ parallelMaxConcurrency: { type: "number", description: "Maximum concurrent parallel instances. Only relevant when parallelism > 1." },
507
+ parallelExport: {
508
+ type: "string",
509
+ enum: ["Combined", "Separated"],
510
+ description: "How parallel run exports are handled. 'Combined' merges output, 'Separated' keeps per-instance files.",
511
+ },
512
+ logLevel: {
513
+ type: "string",
514
+ enum: ["Fatal", "Error", "Warning", "Info"],
515
+ description: "Log verbosity for scheduled runs. Default: 'Info'.",
516
+ },
517
+ logMode: {
518
+ type: "string",
519
+ enum: ["Text", "TextAndHtml"],
520
+ description: "Log format. 'Text' for plain text, 'TextAndHtml' for both. Default: 'Text'.",
521
+ },
522
+ isExclusive: { type: "boolean", description: "If true, prevents concurrent runs of this agent." },
523
+ isWaitOnFailure: { type: "boolean", description: "If true, waits before retrying after a failure." },
524
+ // NOTE: proxyPoolId and serverGroupId are intentionally omitted from the MCP tool.
525
+ // The API supports them, but users have no way to discover valid IDs through the MCP
526
+ // (no list-proxy-pools or list-server-groups endpoints exist). Users needing these
527
+ // should configure them via the Sequentum dashboard.
528
+ // localSchedule is also omitted — it's a human-readable string generated server-side.
529
+ },
530
+ required: ["agentId", "scheduleId", "name"],
531
+ },
532
+ annotations: {
533
+ title: "Update Agent Schedule",
534
+ readOnlyHint: false,
535
+ destructiveHint: false,
536
+ openWorldHint: false,
537
+ },
538
+ },
539
+ {
540
+ name: "enable_agent_schedule",
541
+ description: "Enable a previously disabled schedule so it will run according to its configuration. " +
542
+ "Answers: 'Turn on the schedule', 'Re-enable the Monday schedule', 'Activate schedule X'. " +
543
+ "TIP: Use list_agent_schedules to check current isEnabled status first.",
544
+ inputSchema: {
545
+ type: "object",
546
+ properties: {
547
+ agentId: { type: "number", description: "The unique ID of the agent." },
548
+ scheduleId: { type: "number", description: "The schedule ID to enable. Get this from list_agent_schedules." },
549
+ },
550
+ required: ["agentId", "scheduleId"],
551
+ },
552
+ annotations: {
553
+ title: "Enable Agent Schedule",
554
+ readOnlyHint: false,
555
+ destructiveHint: false,
556
+ openWorldHint: false,
557
+ },
558
+ },
559
+ {
560
+ name: "disable_agent_schedule",
561
+ description: "Disable a schedule so it will not run until re-enabled. The schedule is preserved but inactive. " +
562
+ "Answers: 'Pause the schedule', 'Turn off the daily run', 'Disable schedule X temporarily'. " +
563
+ "TIP: Unlike delete, this preserves the schedule configuration. Use enable_agent_schedule to reactivate.",
564
+ inputSchema: {
565
+ type: "object",
566
+ properties: {
567
+ agentId: { type: "number", description: "The unique ID of the agent." },
568
+ scheduleId: { type: "number", description: "The schedule ID to disable. Get this from list_agent_schedules." },
569
+ },
570
+ required: ["agentId", "scheduleId"],
571
+ },
572
+ annotations: {
573
+ title: "Disable Agent Schedule",
574
+ readOnlyHint: false,
575
+ destructiveHint: false,
576
+ openWorldHint: false,
577
+ },
578
+ },
579
+ {
580
+ name: "get_scheduled_runs",
581
+ description: "Get all upcoming scheduled runs across all agents in a date range. Shows what will run and when. " +
582
+ "Answers: 'What runs this week?', 'Show upcoming schedules', 'What agents are scheduled tomorrow?'. " +
583
+ "Returns: Array of upcoming runs with scheduleId, agentId, agentName, scheduleName, nextRunTime, isEnabled. " +
584
+ "TIP: If no dates provided, defaults to the next 7 days.",
585
+ inputSchema: {
586
+ type: "object",
587
+ properties: {
588
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Example: '2026-01-16'. Defaults to today." },
589
+ endDate: { type: "string", description: "End date in ISO 8601 format. Example: '2026-01-23'. Defaults to 7 days from start." },
590
+ },
591
+ required: [],
592
+ },
593
+ annotations: {
594
+ title: "Get Scheduled Runs",
595
+ readOnlyHint: true,
596
+ },
597
+ },
598
+ // Billing/Credits Tools
599
+ {
600
+ name: "get_credits_balance",
601
+ description: "Get the current available credits balance for the organization. " +
602
+ "Answers: 'How many credits do I have?', 'What's my balance?', 'Check credits'. " +
603
+ "Returns: availableCredits, organizationId, retrievedAt timestamp.",
604
+ inputSchema: { type: "object", properties: {}, required: [] },
605
+ annotations: {
606
+ title: "Get Credits Balance",
607
+ readOnlyHint: true,
608
+ },
609
+ },
610
+ {
611
+ name: "get_spending_summary",
612
+ description: "Get a summary of credits spent in a date range. " +
613
+ "Answers: 'How much have I spent?', 'What's my usage this week?', 'Show spending for January'. " +
614
+ "Returns: totalSpent, startDate, endDate, currentBalance. " +
615
+ "TIP: If no dates provided, returns spending for the current period.",
616
+ inputSchema: {
617
+ type: "object",
618
+ properties: {
619
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Example: '2026-01-01'." },
620
+ endDate: { type: "string", description: "End date in ISO 8601 format. Example: '2026-01-31'." },
621
+ },
622
+ required: [],
623
+ },
624
+ annotations: {
625
+ title: "Get Spending Summary",
626
+ readOnlyHint: true,
627
+ },
628
+ },
629
+ {
630
+ name: "get_credit_history",
631
+ description: "Get the transaction history of credits (additions from purchases, deductions from usage). " +
632
+ "Answers: 'Show credit history', 'What were my credit transactions?', 'When were credits added?'. " +
633
+ "Returns: Array of transactions with transactionType, amount, balance, created date, message.",
634
+ inputSchema: {
635
+ type: "object",
636
+ properties: {
637
+ pageIndex: { type: "number", description: "Page number (1-based). Default: 1." },
638
+ recordsPerPage: { type: "number", description: "Records per page. Default: 50, Max: 100." },
639
+ },
640
+ required: [],
641
+ },
642
+ annotations: {
643
+ title: "Get Credit History",
644
+ readOnlyHint: true,
645
+ },
646
+ },
647
+ {
648
+ name: "get_agents_usage",
649
+ description: "Get all agents with their total costs for a date range, with filtering and sorting options. " +
650
+ "USE THIS to analyze which agents are costing the most, compare agent costs, or track spending by agent. " +
651
+ "Answers: 'Which agents cost the most?', 'Show agent costs this month', 'What did agent X cost in January?'. " +
652
+ "Returns: Paginated list of agents with agentId, agentName, cost, spaceId, plus totalRecordCount and totalCost. " +
653
+ "TIP: Use sortColumn='cost' and sortOrder=1 to see most expensive agents first. Filter by name to find specific agents. Usage types: 'Server Time,Export GB,Agent Inputs,Proxy Data,Export CPM'.",
654
+ inputSchema: {
655
+ type: "object",
656
+ properties: {
657
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Defaults to start of current month. Example: '2026-01-01' or '2026-01-01T00:00:00Z'." },
658
+ endDate: { type: "string", description: "End date in ISO 8601 format. Defaults to now. Example: '2026-01-31' or '2026-01-31T23:59:59Z'." },
659
+ pageIndex: { type: "number", description: "Page number (1-based). Default: 1." },
660
+ recordsPerPage: { type: "number", description: "Records per page. Default: 50, Max: 1000." },
661
+ sortColumn: { type: "string", description: "Column to sort by: 'name' or 'cost'. Default: 'name'." },
662
+ sortOrder: { type: "number", description: "Sort order: 0 = ascending, 1 = descending. Default: 0." },
663
+ name: { type: "string", description: "Filter by agent name (case-insensitive contains match)." },
664
+ usageTypes: { type: "string", description: "Filter by usage types (comma-separated). Example: 'Server Time,Export GB'." },
665
+ },
666
+ required: [],
667
+ },
668
+ annotations: {
669
+ title: "Get Agents Usage",
670
+ readOnlyHint: true,
671
+ },
672
+ },
673
+ {
674
+ name: "get_agent_cost_breakdown",
675
+ description: "Get detailed cost breakdown by usage type for a specific agent over time, useful for visualizing costs in charts. " +
676
+ "USE THIS to understand what's driving costs for an agent (server time vs exports vs proxies), or to chart agent costs over time. " +
677
+ "Answers: 'What's causing agent X's costs?', 'Show me cost breakdown for agent 123', 'Chart agent costs by day'. " +
678
+ "Returns: Cost data with agentId, agentName, date labels array, usageTypes array (each with type name, data points, totalCost), totalCost, startDate, endDate. " +
679
+ "TIP: Use timeUnit='day' for daily granularity or 'month' for monthly. The labels array corresponds to data points in each usageTypes.data array.",
680
+ inputSchema: {
681
+ type: "object",
682
+ properties: {
683
+ agentId: { type: "number", description: "The unique ID of the agent." },
684
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Defaults to start of current month. Example: '2026-01-01' or '2026-01-01T00:00:00Z'." },
685
+ endDate: { type: "string", description: "End date in ISO 8601 format. Defaults to now. Example: '2026-01-31' or '2026-01-31T23:59:59Z'." },
686
+ timeUnit: { type: "string", description: "Time unit for grouping: 'day' or 'month'. Default: 'day'." },
687
+ usageTypes: { type: "string", description: "Filter by usage types (comma-separated). Example: 'Server Time,Export GB'." },
688
+ },
689
+ required: ["agentId"],
690
+ },
691
+ annotations: {
692
+ title: "Get Agent Cost Breakdown",
693
+ readOnlyHint: true,
694
+ },
695
+ },
696
+ {
697
+ name: "get_agent_runs_cost",
698
+ description: "Get individual run costs for a specific agent with detailed run information and filtering options. " +
699
+ "USE THIS to drill down into specific runs, identify expensive runs, or analyze run costs over time. " +
700
+ "Answers: 'Which runs were most expensive?', 'Show run costs for agent X', 'What did run Y cost?'. " +
701
+ "Returns: Paginated list of runs with runId, date, startTime, endTime, cost, billingType, plus agentId, agentName, totalRecordCount and totalCost. " +
702
+ "TIP: Sort by cost (sortColumn='cost', sortOrder=1) to find most expensive runs. Filter by usageTypes to see specific cost categories.",
703
+ inputSchema: {
704
+ type: "object",
705
+ properties: {
706
+ agentId: { type: "number", description: "The unique ID of the agent." },
707
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Defaults to start of current month. Example: '2026-01-01' or '2026-01-01T00:00:00Z'." },
708
+ endDate: { type: "string", description: "End date in ISO 8601 format. Defaults to now. Example: '2026-01-31' or '2026-01-31T23:59:59Z'." },
709
+ pageIndex: { type: "number", description: "Page number (1-based). Default: 1." },
710
+ recordsPerPage: { type: "number", description: "Records per page. Default: 50, Max: 1000." },
711
+ sortColumn: { type: "string", description: "Column to sort by: 'date', 'cost', or 'duration'. Default: 'date'." },
712
+ sortOrder: { type: "number", description: "Sort order: 0 = ascending, 1 = descending. Default: 0." },
713
+ usageTypes: { type: "string", description: "Filter by usage types (comma-separated). Example: 'Server Time,Proxy Data'." },
714
+ },
715
+ required: ["agentId"],
716
+ },
717
+ annotations: {
718
+ title: "Get Agent Runs Cost",
719
+ readOnlyHint: true,
720
+ },
721
+ },
722
+ // Space Tools
723
+ {
724
+ name: "list_spaces",
725
+ description: "List all accessible spaces (folders for organizing agents into groups). " +
726
+ "Answers: 'What spaces do I have?', 'Show my folders', 'List agent groups'. " +
727
+ "Returns: Array of spaces with id, name, description. " +
728
+ "USE THIS to find spaceId before using get_space_agents or filtering list_agents by space.",
729
+ inputSchema: { type: "object", properties: {}, required: [] },
730
+ annotations: {
731
+ title: "List Spaces",
732
+ readOnlyHint: true,
733
+ },
734
+ },
735
+ {
736
+ name: "get_space",
737
+ description: "Get details of a specific space including its description and settings. " +
738
+ "Answers: 'Tell me about space X', 'Show space details'. " +
739
+ "Returns: Space details with id, name, description, organizationId, created/updated dates.",
740
+ inputSchema: {
741
+ type: "object",
742
+ properties: {
743
+ spaceId: { type: "number", description: "The unique ID of the space. Get this from list_spaces." },
744
+ },
745
+ required: ["spaceId"],
746
+ },
747
+ annotations: {
748
+ title: "Get Space",
749
+ readOnlyHint: true,
750
+ },
751
+ },
752
+ {
753
+ name: "get_space_agents",
754
+ description: "List all agents that belong to a specific space. " +
755
+ "Answers: 'What agents are in space X?', 'Show agents in the Production folder'. " +
756
+ "Returns: Array of agents in the space with id, name, status, configType, lastActivity. " +
757
+ "ALTERNATIVE: You can also use list_agents with spaceId filter.",
758
+ inputSchema: {
759
+ type: "object",
760
+ properties: {
761
+ spaceId: { type: "number", description: "The unique ID of the space. Get this from list_spaces or search_space_by_name." },
762
+ },
763
+ required: ["spaceId"],
764
+ },
765
+ annotations: {
766
+ title: "Get Space Agents",
767
+ readOnlyHint: true,
768
+ },
769
+ },
770
+ {
771
+ name: "search_space_by_name",
772
+ description: "Find a space by its name. Use when user mentions a space by name instead of ID. " +
773
+ "Answers: 'Find the Production space', 'Get the Bot Blocking folder'. " +
774
+ "Returns: Matching space with id, name, description. " +
775
+ "NEXT STEP: Use the returned spaceId with get_space_agents or run_space_agents.",
776
+ inputSchema: {
777
+ type: "object",
778
+ properties: {
779
+ name: { type: "string", description: "The space name to search for. Case-insensitive." },
780
+ },
781
+ required: ["name"],
782
+ },
783
+ annotations: {
784
+ title: "Search Space by Name",
785
+ readOnlyHint: true,
786
+ },
787
+ },
788
+ {
789
+ name: "run_space_agents",
790
+ description: "Start ALL agents in a space at once (batch operation). Useful for running a group of related agents together. " +
791
+ "Answers: 'Run all agents in space X', 'Execute the Production folder', 'Start all scrapers in Bot Blocking'. " +
792
+ "Returns: Summary with totalAgents, agentsStarted, agentsFailed, and individual results. " +
793
+ "WARNING: This starts multiple agents. Use get_space_agents first to see what will run.",
794
+ inputSchema: {
795
+ type: "object",
796
+ properties: {
797
+ spaceId: { type: "number", description: "The unique ID of the space. Get this from list_spaces or search_space_by_name." },
798
+ inputParameters: { type: "string", description: "Optional JSON string of input parameters to pass to ALL agents in the space." },
799
+ },
800
+ required: ["spaceId"],
801
+ },
802
+ annotations: {
803
+ title: "Run Space Agents",
804
+ readOnlyHint: false,
805
+ destructiveHint: false,
806
+ // Batch-runs agents that each scrape external websites — open-world for the same reason as start_agent.
807
+ openWorldHint: true,
808
+ },
809
+ },
810
+ // Analytics Tools
811
+ {
812
+ name: "get_runs_summary",
813
+ description: "Get aggregate statistics about agent runs in a date range: counts of completed, failed, running, etc. " +
814
+ "Answers: 'How many agents ran yesterday?', 'What failed last week?', 'Show run statistics', 'Give me a summary of runs'. " +
815
+ "Returns: totalRuns, completedRuns, failedRuns, completedWithErrorsRuns, runningRuns, queuedRuns, stoppedRuns. " +
816
+ "TIP: Set includeDetails=true to get details of which specific agents failed and why. " +
817
+ "TIP: Use status filter to focus on specific outcomes (e.g., 'Failed' to see only failures).",
818
+ inputSchema: {
819
+ type: "object",
820
+ properties: {
821
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Example: '2026-01-15'. Defaults to today if not specified." },
822
+ endDate: { type: "string", description: "End date in ISO 8601 format. Example: '2026-01-16'. Defaults to today if not specified." },
823
+ status: { type: "string", description: "Filter by run status: 'Failed', 'Completed', 'CompletedWithErrors', 'Running'. Only shows runs with this status." },
824
+ includeDetails: { type: "boolean", description: "If true, includes failedRunDetails array with specific agent names and error messages. Default: true." },
825
+ },
826
+ required: [],
827
+ },
828
+ annotations: {
829
+ title: "Get Runs Summary",
830
+ readOnlyHint: true,
831
+ },
832
+ },
833
+ {
834
+ name: "get_records_summary",
835
+ description: "Get a summary of how many records were extracted and exported by agents in a date range. " +
836
+ "Answers: 'How many records were scraped?', 'What was the output yesterday?', 'Show extraction statistics'. " +
837
+ "Returns: totalRecordsExtracted, totalRecordsExported, totalErrors, totalPageLoads, runCount. " +
838
+ "TIP: Use agentId filter to see statistics for a specific agent only.",
839
+ inputSchema: {
840
+ type: "object",
841
+ properties: {
842
+ startDate: { type: "string", description: "Start date in ISO 8601 format. Example: '2026-01-15'." },
843
+ endDate: { type: "string", description: "End date in ISO 8601 format. Example: '2026-01-16'." },
844
+ agentId: { type: "number", description: "Optional: Filter to show records for a specific agent only." },
845
+ },
846
+ required: [],
847
+ },
848
+ annotations: {
849
+ title: "Get Records Summary",
850
+ readOnlyHint: true,
851
+ },
852
+ },
853
+ {
854
+ name: "get_run_diagnostics",
855
+ description: "Get detailed diagnostics for a specific run, including error messages, possible causes, and suggested fixes. " +
856
+ "Answers: 'Why did run X fail?', 'Show error details for this run', 'Debug run 123'. " +
857
+ "Returns: errorMessage, possibleCauses (array), suggestedActions (array), run timing and stats. " +
858
+ "USE THIS when you have a specific runId. Use get_latest_failure if you just want the most recent failure.",
859
+ inputSchema: {
860
+ type: "object",
861
+ properties: {
862
+ agentId: { type: "number", description: "The unique ID of the agent." },
863
+ runId: { type: "number", description: "The run ID to diagnose. Get this from get_agent_runs." },
864
+ },
865
+ required: ["agentId", "runId"],
866
+ },
867
+ annotations: {
868
+ title: "Get Run Diagnostics",
869
+ readOnlyHint: true,
870
+ },
871
+ },
872
+ {
873
+ name: "get_latest_failure",
874
+ description: "Get diagnostics for the most recent failed run of an agent. Includes error analysis and suggested fixes. " +
875
+ "Answers: 'Why did my agent fail?', 'What went wrong?', 'Debug agent X', 'Show the last error'. " +
876
+ "Returns: errorMessage, possibleCauses, suggestedActions, run timing and stats. " +
877
+ "USE THIS instead of get_run_diagnostics when user asks about failure without specifying a run ID. " +
878
+ "SHORTCUT: This is faster than calling get_agent_runs + filtering for Failed + get_run_diagnostics.",
879
+ inputSchema: {
880
+ type: "object",
881
+ properties: {
882
+ agentId: { type: "number", description: "The unique ID of the agent. Get this from list_agents, search_agents, or get_agent_build_status (when building a new agent)." },
883
+ },
884
+ required: ["agentId"],
885
+ },
886
+ annotations: {
887
+ title: "Get Latest Failure",
888
+ readOnlyHint: true,
889
+ },
890
+ },
891
+ // Agent Builder Tools
892
+ {
893
+ name: "start_agent_build",
894
+ description: "Start a new AI-powered agent building session from a natural language prompt. " +
895
+ "The agent is built asynchronously — this call returns immediately with a sessionId. " +
896
+ "The agent is saved to your workspace as soon as the AI creates it. " +
897
+ "NEXT STEP: Poll get_agent_build_status until status reaches 'completed', 'ready', or 'error' — then stop polling; the session tears down automatically. " +
898
+ "Optionally call stop_agent_build to abort early while still in 'processing'. " +
899
+ "If spaceName is known, resolve it to a spaceId via search_space_by_name first. " +
900
+ "PRE-CALL CHECK: Before calling, verify the request unambiguously specifies (1) the target URL or domain, (2) the data to extract, and (3) any scope qualifiers (section, filters, language). If any of these are missing, ask one consolidated clarifying question covering all gaps instead of inventing values. " +
901
+ PROMPT_HANDLING_POLICY,
902
+ inputSchema: {
903
+ type: "object",
904
+ properties: {
905
+ prompt: {
906
+ type: "string",
907
+ description: "The user's automation request, passed through as closely as possible to their original wording. " +
908
+ "Do not add fields, formatting rules, or scraping techniques the user did not mention. " +
909
+ "Must be between 10 and 5000 characters (trimmed). " +
910
+ "Example: user says 'get product names and prices from example.com/shop/shoes' → send 'get product names and prices from https://example.com/shop/shoes'.",
911
+ minLength: 10,
912
+ maxLength: 5000,
913
+ },
914
+ spaceId: {
915
+ type: "number",
916
+ description: "Optional space ID to associate the agent with. Use search_space_by_name to get the ID from a name. " +
917
+ "If omitted, the default space is used.",
918
+ },
919
+ },
920
+ required: ["prompt"],
921
+ },
922
+ annotations: {
923
+ title: "Build Agent from Prompt",
924
+ readOnlyHint: false,
925
+ destructiveHint: false,
926
+ // Build pipeline fetches the target website to learn its structure — open-world.
927
+ openWorldHint: true,
928
+ },
929
+ },
930
+ {
931
+ name: "get_agent_build_status",
932
+ description: "Poll the status of an agent building session. " +
933
+ "Returns { status, agentId?, agentName?, error? }. " +
934
+ "status: 'processing' (keep polling) | 'ready' | 'completed' | 'error' | 'cancelled'. " +
935
+ "STOP POLLING on: completed, ready, error, or cancelled — the session tears down automatically. " +
936
+ "The returned agentId is the permanent workspace ID usable with get_agent, run_agent, schedule tools, and every other endpoint that takes an agentId. " +
937
+ "POLLING CADENCE: honor any user-expressed preference (e.g., 'poll quickly', 'every N seconds'); otherwise use moderate backoff (~5s start, max ~30s between polls).",
938
+ inputSchema: {
939
+ type: "object",
940
+ properties: {
941
+ sessionId: {
942
+ type: "string",
943
+ description: "The session ID returned by start_agent_build.",
944
+ },
945
+ },
946
+ required: ["sessionId"],
947
+ },
948
+ annotations: {
949
+ title: "Get Agent Build Status",
950
+ readOnlyHint: true,
951
+ },
952
+ },
953
+ {
954
+ name: "stop_agent_build",
955
+ description: "Abort an in-progress agent building session early. Optional — only needed if you want to cancel before the build completes. " +
956
+ "Has no effect once the session has already reached a terminal status (completed, ready, error, or cancelled). " +
957
+ "Any agent already saved to your workspace before the abort remains there — use the standard agents API to delete it if unwanted. " +
958
+ "Returns 204 No Content.",
959
+ inputSchema: {
960
+ type: "object",
961
+ properties: {
962
+ sessionId: {
963
+ type: "string",
964
+ description: "The session ID returned by start_agent_build.",
965
+ },
966
+ },
967
+ required: ["sessionId"],
968
+ },
969
+ annotations: {
970
+ title: "Stop Agent Build",
971
+ readOnlyHint: false,
972
+ destructiveHint: false,
973
+ openWorldHint: false,
974
+ },
975
+ },
976
+ ];
977
+ //# sourceMappingURL=tools.js.map