@cronicorn/mcp-server 1.6.0 → 1.6.1

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.
package/dist/index.js CHANGED
@@ -12735,127 +12735,6 @@ function createHttpApiClient(config) {
12735
12735
  // src/tools/api/delete-endpoint.ts
12736
12736
  init_esm_shims();
12737
12737
 
12738
- // src/tools/helpers/index.ts
12739
- init_esm_shims();
12740
-
12741
- // src/tools/helpers/api-tool.ts
12742
- init_esm_shims();
12743
- function createErrorResponse(error) {
12744
- if (error instanceof ApiError) {
12745
- return {
12746
- content: [
12747
- {
12748
- type: "text",
12749
- text: `API Error (${error.statusCode}): ${error.message}`
12750
- }
12751
- ],
12752
- isError: true
12753
- };
12754
- }
12755
- const message = error instanceof Error ? error.message : String(error);
12756
- return {
12757
- content: [
12758
- {
12759
- type: "text",
12760
- text: `Error: ${message}`
12761
- }
12762
- ],
12763
- isError: true
12764
- };
12765
- }
12766
- function createSuccessResponse(output, message) {
12767
- return {
12768
- content: [
12769
- {
12770
- type: "text",
12771
- text: message || "\u2705 Operation successful"
12772
- }
12773
- ],
12774
- structuredContent: output
12775
- };
12776
- }
12777
- function registerApiTool(server, apiClient, config) {
12778
- server.registerTool(
12779
- config.name,
12780
- {
12781
- title: config.title,
12782
- description: config.description,
12783
- inputSchema: config.inputSchema,
12784
- outputSchema: config.outputSchema
12785
- },
12786
- async (params) => {
12787
- try {
12788
- const validatedInput = config.inputValidator.parse(params);
12789
- const path4 = typeof config.path === "function" ? config.path(validatedInput) : config.path;
12790
- const body = config.transformInput ? config.transformInput(validatedInput) : validatedInput;
12791
- const requestOptions = {
12792
- method: config.method
12793
- };
12794
- if (["POST", "PATCH", "PUT"].includes(config.method)) {
12795
- requestOptions.body = JSON.stringify(body);
12796
- }
12797
- const response = await apiClient.fetch(path4, requestOptions);
12798
- const validatedResponse = config.outputValidator.parse(response);
12799
- const message = config.successMessage ? config.successMessage(validatedResponse) : void 0;
12800
- return createSuccessResponse(validatedResponse, message);
12801
- } catch (error) {
12802
- return createErrorResponse(error);
12803
- }
12804
- }
12805
- );
12806
- }
12807
-
12808
- // src/tools/helpers/schema-utils.ts
12809
- init_esm_shims();
12810
- function toShape(schema) {
12811
- return schema.shape;
12812
- }
12813
-
12814
- // src/tools/api/delete-endpoint.ts
12815
- var DeleteEndpointRequestSchema = external_exports.object({
12816
- jobId: external_exports.string().describe("Parent job ID"),
12817
- id: external_exports.string().describe("Endpoint ID to delete")
12818
- });
12819
- var EmptyResponseSchema = external_exports.object({});
12820
- function registerDeleteEndpoint(server, apiClient) {
12821
- registerApiTool(server, apiClient, {
12822
- name: "DELETE_jobs_jobId_endpoints_id",
12823
- title: "Delete Endpoint",
12824
- description: "Permanently delete an endpoint. This action cannot be undone. All associated run history will be deleted.",
12825
- inputSchema: toShape(DeleteEndpointRequestSchema),
12826
- outputSchema: toShape(EmptyResponseSchema),
12827
- inputValidator: DeleteEndpointRequestSchema,
12828
- outputValidator: EmptyResponseSchema,
12829
- method: "DELETE",
12830
- path: (input) => `/jobs/${input.jobId}/endpoints/${input.id}`,
12831
- successMessage: () => `\u2705 Endpoint deleted successfully`
12832
- });
12833
- }
12834
-
12835
- // src/tools/api/delete-hints.ts
12836
- init_esm_shims();
12837
- var DeleteHintsRequestSchema = external_exports.object({
12838
- id: external_exports.string().describe("Endpoint ID")
12839
- });
12840
- var EmptyResponseSchema2 = external_exports.object({});
12841
- function registerDeleteHints(server, apiClient) {
12842
- registerApiTool(server, apiClient, {
12843
- name: "DELETE_endpoints_id_hints",
12844
- title: "Clear AI Hints",
12845
- description: "Clear all AI hints (interval and one-shot) for an endpoint. The endpoint will revert to its baseline schedule. Useful for resetting adaptive behavior.",
12846
- inputSchema: toShape(DeleteHintsRequestSchema),
12847
- outputSchema: toShape(EmptyResponseSchema2),
12848
- inputValidator: DeleteHintsRequestSchema,
12849
- outputValidator: EmptyResponseSchema2,
12850
- method: "DELETE",
12851
- path: (input) => `/endpoints/${input.id}/hints`,
12852
- successMessage: () => `\u2705 AI hints cleared successfully`
12853
- });
12854
- }
12855
-
12856
- // src/tools/api/delete-job.ts
12857
- init_esm_shims();
12858
-
12859
12738
  // ../../packages/api-contracts/dist/jobs/index.js
12860
12739
  init_esm_shims();
12861
12740
 
@@ -12891,40 +12770,40 @@ function validateCronExpression(expr) {
12891
12770
  }
12892
12771
  }
12893
12772
  var CreateJobRequestBaseSchema = external_exports.object({
12894
- name: external_exports.string().min(1).max(255),
12895
- description: external_exports.string().max(1e3).optional()
12773
+ name: external_exports.string().min(1).max(255).describe("Job name"),
12774
+ description: external_exports.string().max(1e3).optional().describe("Job description")
12896
12775
  });
12897
12776
  var UpdateJobRequestBaseSchema = external_exports.object({
12898
- name: external_exports.string().min(1).max(255).optional(),
12899
- description: external_exports.string().max(1e3).optional()
12777
+ name: external_exports.string().min(1).max(255).optional().describe("Job name"),
12778
+ description: external_exports.string().max(1e3).optional().describe("Job description")
12900
12779
  });
12901
12780
  var JobResponseBaseSchema = external_exports.object({
12902
- id: external_exports.string(),
12903
- userId: external_exports.string(),
12904
- name: external_exports.string(),
12905
- description: external_exports.string().optional(),
12906
- status: external_exports.enum(["active", "paused", "archived"]),
12907
- createdAt: external_exports.string().datetime(),
12908
- updatedAt: external_exports.string().datetime(),
12909
- archivedAt: external_exports.string().datetime().optional()
12781
+ id: external_exports.string().describe("Job ID"),
12782
+ userId: external_exports.string().describe("User ID"),
12783
+ name: external_exports.string().describe("Job name"),
12784
+ description: external_exports.string().optional().describe("Job description"),
12785
+ status: external_exports.enum(["active", "paused", "archived"]).describe("Job status"),
12786
+ createdAt: external_exports.string().datetime().describe("Creation timestamp"),
12787
+ updatedAt: external_exports.string().datetime().describe("Last update timestamp"),
12788
+ archivedAt: external_exports.string().datetime().optional().describe("Archive timestamp")
12910
12789
  });
12911
12790
  var JobWithCountResponseBaseSchema = JobResponseBaseSchema.extend({
12912
- endpointCount: external_exports.number().int()
12791
+ endpointCount: external_exports.number().int().describe("Number of endpoints in this job")
12913
12792
  });
12914
12793
  var EndpointFieldsBaseSchemaShape = {
12915
- name: external_exports.string().min(1).max(255),
12916
- description: external_exports.string().max(2e3).optional(),
12917
- baselineCron: external_exports.string().optional().refine((val) => !val || validateCronExpression(val), { message: "Invalid cron expression. Use standard 5-field format (minute hour day month weekday)" }),
12918
- baselineIntervalMs: external_exports.number().int().positive().optional(),
12919
- minIntervalMs: external_exports.number().int().positive().optional(),
12920
- maxIntervalMs: external_exports.number().int().positive().optional(),
12921
- url: external_exports.string().url(),
12922
- method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).default("GET"),
12923
- headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional(),
12924
- bodyJson: external_exports.any().optional(),
12925
- timeoutMs: external_exports.number().int().positive().optional(),
12926
- maxExecutionTimeMs: external_exports.number().int().positive().max(18e5).optional(),
12927
- maxResponseSizeKb: external_exports.number().int().positive().optional()
12794
+ name: external_exports.string().min(1).max(255).describe("Endpoint name"),
12795
+ description: external_exports.string().max(2e3).optional().describe("Endpoint-specific context: what it does, response schema, thresholds, coordination logic"),
12796
+ baselineCron: external_exports.string().optional().refine((val) => !val || validateCronExpression(val), { message: "Invalid cron expression. Use standard 5-field format (minute hour day month weekday)" }).describe("Baseline cron expression (standard 5-field format)"),
12797
+ baselineIntervalMs: external_exports.number().int().positive().optional().describe("Baseline interval in milliseconds"),
12798
+ minIntervalMs: external_exports.number().int().positive().optional().describe("Minimum interval in milliseconds"),
12799
+ maxIntervalMs: external_exports.number().int().positive().optional().describe("Maximum interval in milliseconds"),
12800
+ url: external_exports.string().url().describe("HTTP endpoint URL"),
12801
+ method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).default("GET").describe("HTTP method"),
12802
+ headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("HTTP headers as key-value pairs"),
12803
+ bodyJson: external_exports.any().optional().describe("Request body (JSON)"),
12804
+ timeoutMs: external_exports.number().int().positive().optional().describe("Request timeout in milliseconds"),
12805
+ maxExecutionTimeMs: external_exports.number().int().positive().max(18e5).optional().describe("Maximum expected execution time in milliseconds (for lock duration). Default: 60000 (1 minute). Max: 1800000 (30 minutes)."),
12806
+ maxResponseSizeKb: external_exports.number().int().positive().optional().describe("Maximum response size in kilobytes")
12928
12807
  };
12929
12808
  var EndpointFieldsBaseSchema = external_exports.object(EndpointFieldsBaseSchemaShape);
12930
12809
  var EndpointFieldsWithValidationBaseSchema = EndpointFieldsBaseSchema.refine((data) => !data.minIntervalMs || !data.maxIntervalMs || data.minIntervalMs <= data.maxIntervalMs, {
@@ -12943,94 +12822,94 @@ var UpdateEndpointRequestBaseSchema = EndpointFieldsBaseSchema.partial().refine(
12943
12822
  path: ["minIntervalMs"]
12944
12823
  });
12945
12824
  var EndpointResponseBaseSchema = external_exports.object({
12946
- id: external_exports.string(),
12947
- jobId: external_exports.string().optional(),
12948
- name: external_exports.string(),
12949
- description: external_exports.string().optional(),
12950
- baselineCron: external_exports.string().optional(),
12951
- baselineIntervalMs: external_exports.number().optional(),
12952
- minIntervalMs: external_exports.number().optional(),
12953
- maxIntervalMs: external_exports.number().optional(),
12954
- nextRunAt: external_exports.string().datetime(),
12955
- lastRunAt: external_exports.string().datetime().optional(),
12956
- failureCount: external_exports.number().int(),
12957
- pausedUntil: external_exports.string().datetime().optional(),
12958
- url: external_exports.string().optional(),
12959
- method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
12960
- headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional(),
12961
- bodyJson: external_exports.any().optional(),
12962
- timeoutMs: external_exports.number().optional(),
12963
- maxExecutionTimeMs: external_exports.number().optional(),
12964
- maxResponseSizeKb: external_exports.number().optional(),
12965
- aiHintIntervalMs: external_exports.number().int().optional(),
12966
- aiHintNextRunAt: external_exports.string().datetime().optional(),
12967
- aiHintExpiresAt: external_exports.string().datetime().optional(),
12968
- aiHintReason: external_exports.string().optional()
12825
+ id: external_exports.string().describe("Endpoint ID"),
12826
+ jobId: external_exports.string().optional().describe("Parent job ID"),
12827
+ name: external_exports.string().describe("Endpoint name"),
12828
+ description: external_exports.string().optional().describe("Endpoint description"),
12829
+ baselineCron: external_exports.string().optional().describe("Baseline cron expression"),
12830
+ baselineIntervalMs: external_exports.number().optional().describe("Baseline interval in milliseconds"),
12831
+ minIntervalMs: external_exports.number().optional().describe("Minimum interval in milliseconds"),
12832
+ maxIntervalMs: external_exports.number().optional().describe("Maximum interval in milliseconds"),
12833
+ nextRunAt: external_exports.string().datetime().describe("Next scheduled run time"),
12834
+ lastRunAt: external_exports.string().datetime().optional().describe("Last run time"),
12835
+ failureCount: external_exports.number().int().describe("Consecutive failure count"),
12836
+ pausedUntil: external_exports.string().datetime().optional().describe("Pause expiration time"),
12837
+ url: external_exports.string().optional().describe("HTTP endpoint URL"),
12838
+ method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional().describe("HTTP method"),
12839
+ headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("HTTP headers"),
12840
+ bodyJson: external_exports.any().optional().describe("Request body"),
12841
+ timeoutMs: external_exports.number().optional().describe("Request timeout in milliseconds"),
12842
+ maxExecutionTimeMs: external_exports.number().optional().describe("Maximum execution time in milliseconds"),
12843
+ maxResponseSizeKb: external_exports.number().optional().describe("Maximum response size in kilobytes"),
12844
+ aiHintIntervalMs: external_exports.number().int().optional().describe("AI-suggested interval in milliseconds. If both interval and one-shot hints are active, the earliest scheduled time wins."),
12845
+ aiHintNextRunAt: external_exports.string().datetime().optional().describe("AI-suggested next run time (one-shot). If both interval and one-shot hints are active, the earliest scheduled time wins."),
12846
+ aiHintExpiresAt: external_exports.string().datetime().optional().describe("When the AI hint expires"),
12847
+ aiHintReason: external_exports.string().optional().describe("Reason for AI hint")
12969
12848
  });
12970
12849
  var ApplyIntervalHintRequestBaseSchema = external_exports.object({
12971
- intervalMs: external_exports.number().int().positive(),
12972
- ttlMinutes: external_exports.number().int().positive().optional(),
12973
- reason: external_exports.string().optional()
12850
+ intervalMs: external_exports.number().int().positive().describe("AI-suggested interval in milliseconds"),
12851
+ ttlMinutes: external_exports.number().int().positive().optional().describe("Time-to-live for hint in minutes"),
12852
+ reason: external_exports.string().optional().describe("Reason for the interval adjustment")
12974
12853
  });
12975
12854
  var ScheduleOneShotRequestBaseSchema = external_exports.object({
12976
- nextRunAt: external_exports.string().datetime().optional(),
12977
- nextRunInMs: external_exports.number().int().positive().optional(),
12978
- ttlMinutes: external_exports.number().int().positive().optional(),
12979
- reason: external_exports.string().optional()
12855
+ nextRunAt: external_exports.string().datetime().optional().describe("ISO 8601 datetime for next run"),
12856
+ nextRunInMs: external_exports.number().int().positive().optional().describe("Milliseconds from now for next run"),
12857
+ ttlMinutes: external_exports.number().int().positive().optional().describe("Time-to-live for hint in minutes"),
12858
+ reason: external_exports.string().optional().describe("Reason for the one-shot schedule")
12980
12859
  }).refine((data) => data.nextRunAt || data.nextRunInMs !== void 0, { message: "Must provide either nextRunAt or nextRunInMs", path: ["nextRunAt"] });
12981
12860
  var PauseResumeRequestBaseSchema = external_exports.object({
12982
- pausedUntil: external_exports.string().datetime().nullable(),
12983
- reason: external_exports.string().optional()
12861
+ pausedUntil: external_exports.string().datetime().nullable().describe("ISO datetime to pause until (null to resume)"),
12862
+ reason: external_exports.string().optional().describe("Reason for pausing/resuming")
12984
12863
  });
12985
12864
  var ListRunsQueryBaseSchema = external_exports.object({
12986
- endpointId: external_exports.string().optional(),
12987
- status: external_exports.enum(["success", "failed"]).optional(),
12988
- limit: external_exports.coerce.number().int().positive().optional(),
12989
- offset: external_exports.coerce.number().int().nonnegative().optional()
12865
+ endpointId: external_exports.string().optional().describe("Filter by endpoint ID"),
12866
+ status: external_exports.enum(["success", "failed"]).optional().describe("Filter by run status"),
12867
+ limit: external_exports.coerce.number().int().positive().optional().describe("Maximum number of runs to return"),
12868
+ offset: external_exports.coerce.number().int().nonnegative().optional().describe("Number of runs to skip")
12990
12869
  });
12991
12870
  var RunSummaryResponseBaseSchema = external_exports.object({
12992
- runId: external_exports.string(),
12993
- endpointId: external_exports.string(),
12994
- startedAt: external_exports.string().datetime(),
12995
- status: external_exports.string(),
12996
- durationMs: external_exports.number().optional(),
12997
- source: external_exports.string().optional()
12871
+ runId: external_exports.string().describe("Run ID"),
12872
+ endpointId: external_exports.string().describe("Endpoint ID"),
12873
+ startedAt: external_exports.string().datetime().describe("Run start time"),
12874
+ status: external_exports.string().describe("Run status"),
12875
+ durationMs: external_exports.number().optional().describe("Execution duration in milliseconds"),
12876
+ source: external_exports.string().optional().describe("Scheduling source that triggered this run")
12998
12877
  });
12999
12878
  var ListRunsResponseBaseSchema = external_exports.object({
13000
- runs: external_exports.array(RunSummaryResponseBaseSchema),
13001
- total: external_exports.number().int()
12879
+ runs: external_exports.array(RunSummaryResponseBaseSchema).describe("List of run summaries"),
12880
+ total: external_exports.number().int().describe("Total number of runs matching filters")
13002
12881
  });
13003
12882
  var RunDetailsResponseBaseSchema = external_exports.object({
13004
- id: external_exports.string(),
13005
- endpointId: external_exports.string(),
13006
- status: external_exports.string(),
13007
- startedAt: external_exports.string().datetime(),
13008
- finishedAt: external_exports.string().datetime().optional(),
13009
- durationMs: external_exports.number().optional(),
13010
- errorMessage: external_exports.string().optional(),
13011
- source: external_exports.string().optional(),
13012
- attempt: external_exports.number().int(),
13013
- responseBody: external_exports.any().nullable().optional(),
13014
- statusCode: external_exports.number().int().optional(),
12883
+ id: external_exports.string().describe("Run ID"),
12884
+ endpointId: external_exports.string().describe("Endpoint ID"),
12885
+ status: external_exports.string().describe("Run status"),
12886
+ startedAt: external_exports.string().datetime().describe("Run start time"),
12887
+ finishedAt: external_exports.string().datetime().optional().describe("Run finish time"),
12888
+ durationMs: external_exports.number().optional().describe("Execution duration in milliseconds"),
12889
+ errorMessage: external_exports.string().optional().describe("Error message if run failed"),
12890
+ source: external_exports.string().optional().describe("Scheduling source that triggered this run"),
12891
+ attempt: external_exports.number().int().describe("Execution attempt number"),
12892
+ responseBody: external_exports.any().nullable().optional().describe("Response body from endpoint execution (if JSON and within size limit)"),
12893
+ statusCode: external_exports.number().int().optional().describe("HTTP status code from endpoint response"),
13015
12894
  endpoint: external_exports.object({
13016
- id: external_exports.string(),
13017
- name: external_exports.string(),
13018
- url: external_exports.string().optional(),
13019
- method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional()
13020
- }).optional()
12895
+ id: external_exports.string().describe("Endpoint ID"),
12896
+ name: external_exports.string().describe("Endpoint name"),
12897
+ url: external_exports.string().optional().describe("Endpoint URL"),
12898
+ method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional().describe("HTTP method")
12899
+ }).optional().describe("Endpoint details for debugging")
13021
12900
  });
13022
12901
  var HealthSummaryQueryBaseSchema = external_exports.object({
13023
- sinceHours: external_exports.coerce.number().int().positive().optional()
12902
+ sinceHours: external_exports.coerce.number().int().positive().optional().describe("Number of hours to look back for health metrics")
13024
12903
  });
13025
12904
  var HealthSummaryResponseBaseSchema = external_exports.object({
13026
- successCount: external_exports.number().int(),
13027
- failureCount: external_exports.number().int(),
13028
- avgDurationMs: external_exports.number().nullable(),
12905
+ successCount: external_exports.number().int().describe("Number of successful runs"),
12906
+ failureCount: external_exports.number().int().describe("Number of failed runs"),
12907
+ avgDurationMs: external_exports.number().nullable().describe("Average execution duration in milliseconds"),
13029
12908
  lastRun: external_exports.object({
13030
- status: external_exports.string(),
13031
- at: external_exports.string().datetime()
13032
- }).nullable(),
13033
- failureStreak: external_exports.number().int()
12909
+ status: external_exports.string().describe("Status of last run"),
12910
+ at: external_exports.string().datetime().describe("Timestamp of last run")
12911
+ }).nullable().describe("Last run information"),
12912
+ failureStreak: external_exports.number().int().describe("Current consecutive failure count")
13034
12913
  });
13035
12914
 
13036
12915
  // ../../packages/api-contracts/dist/jobs/schemas.js
@@ -13488,32 +13367,52 @@ extendZodWithOpenApi(external_exports);
13488
13367
 
13489
13368
  // ../../packages/api-contracts/dist/jobs/schemas.js
13490
13369
  var import_cron_parser2 = __toESM(require_parser(), 1);
13370
+ var CreateJobSummary = "Create a new job";
13371
+ var CreateJobDescription = "Create a new job. Jobs are containers for endpoints that execute on schedules. After creating a job, use the addEndpoint tool to add executable endpoints.";
13372
+ var GetJobSummary = "Get a job by ID";
13373
+ var GetJobDescription = "Retrieve a single job by ID. Returns full job details including status and timestamps.";
13374
+ var ListJobsSummary = "List all jobs";
13375
+ var ListJobsDescription = "List all jobs for the authenticated user. Optionally filter by status (active, paused, archived). Returns jobs with endpoint counts.";
13376
+ var UpdateJobSummary = "Update a job";
13377
+ var UpdateJobDescription = "Update job name or description. All fields are optional - only provided fields will be updated.";
13378
+ var ArchiveJobSummary = "Archive a job";
13379
+ var ArchiveJobDescription = "Archive a job (soft delete). The job status will be set to 'archived' and an archivedAt timestamp will be recorded. Archived jobs can be recovered if needed.";
13380
+ var PauseJobSummary = "Pause a job";
13381
+ var PauseJobDescription = "Pause a job. The job status will be set to 'paused' and all associated endpoints will stop executing until resumed.";
13382
+ var ResumeJobSummary = "Resume a job";
13383
+ var ResumeJobDescription = "Resume a paused job. The job status will be set to 'active' and all associated endpoints will resume executing on their schedules.";
13384
+ var GetJobRequestSchema = external_exports.object({
13385
+ id: external_exports.string().openapi({
13386
+ description: "Job ID",
13387
+ example: "job_1234567890abcdef"
13388
+ }).describe("Job ID")
13389
+ });
13491
13390
  var CreateJobRequestSchema = external_exports.object({
13492
13391
  name: external_exports.string().min(1).max(255).openapi({
13493
13392
  description: "Job name",
13494
13393
  example: "Daily sales report"
13495
- }),
13394
+ }).describe("Job name"),
13496
13395
  description: external_exports.string().max(1e3).optional().openapi({
13497
13396
  description: "Job description",
13498
13397
  example: "Generates daily sales metrics"
13499
- })
13398
+ }).describe("Job description")
13500
13399
  });
13501
13400
  var UpdateJobRequestSchema = external_exports.object({
13502
- name: external_exports.string().min(1).max(255).optional(),
13503
- description: external_exports.string().max(1e3).optional()
13401
+ name: external_exports.string().min(1).max(255).optional().describe("Job name"),
13402
+ description: external_exports.string().max(1e3).optional().describe("Job description")
13504
13403
  });
13505
13404
  var JobResponseSchema = external_exports.object({
13506
- id: external_exports.string(),
13507
- userId: external_exports.string(),
13508
- name: external_exports.string(),
13509
- description: external_exports.string().optional(),
13510
- status: external_exports.enum(["active", "paused", "archived"]),
13511
- createdAt: external_exports.string().datetime(),
13512
- updatedAt: external_exports.string().datetime(),
13513
- archivedAt: external_exports.string().datetime().optional()
13405
+ id: external_exports.string().describe("Job ID"),
13406
+ userId: external_exports.string().describe("User ID"),
13407
+ name: external_exports.string().describe("Job name"),
13408
+ description: external_exports.string().optional().describe("Job description"),
13409
+ status: external_exports.enum(["active", "paused", "archived"]).describe("Job status"),
13410
+ createdAt: external_exports.string().datetime().describe("Creation timestamp"),
13411
+ updatedAt: external_exports.string().datetime().describe("Last update timestamp"),
13412
+ archivedAt: external_exports.string().datetime().optional().describe("Archive timestamp")
13514
13413
  });
13515
13414
  var JobWithCountResponseSchema = JobResponseSchema.extend({
13516
- endpointCount: external_exports.number().int()
13415
+ endpointCount: external_exports.number().int().describe("Number of endpoints in this job")
13517
13416
  });
13518
13417
  function validateCronExpression2(expr) {
13519
13418
  try {
@@ -13523,26 +13422,36 @@ function validateCronExpression2(expr) {
13523
13422
  return false;
13524
13423
  }
13525
13424
  }
13425
+ var AddEndpointSummary = "Add endpoint to job";
13426
+ var AddEndpointDescription = "Add an endpoint to a job. Must provide either baselineCron OR baselineIntervalMs (not both). The endpoint will execute according to the baseline schedule and can be dynamically adjusted with AI hints.";
13427
+ var GetEndpointSummary = "Get endpoint by ID";
13428
+ var GetEndpointDescription = "Retrieve a single endpoint by ID. Returns full configuration including baseline schedule, AI hints, execution settings, and current state.";
13429
+ var ListEndpointsSummary = "List job endpoints";
13430
+ var ListEndpointsDescription = "List all endpoints for a job. Returns complete endpoint configurations including schedules, AI hints, and execution settings.";
13431
+ var UpdateEndpointSummary = "Update endpoint";
13432
+ var UpdateEndpointDescription = "Update endpoint configuration. All fields are optional - only provided fields will be updated.";
13433
+ var DeleteEndpointSummary = "Delete endpoint";
13434
+ var DeleteEndpointDescription = "Permanently delete an endpoint. This action cannot be undone. All associated run history will be deleted.";
13526
13435
  var EndpointFieldsBaseSchema2 = external_exports.object({
13527
- name: external_exports.string().min(1).max(255),
13436
+ name: external_exports.string().min(1).max(255).describe("Endpoint name"),
13528
13437
  description: external_exports.string().max(2e3).optional().openapi({
13529
13438
  description: "Endpoint-specific context: what it does, response schema, thresholds, coordination logic",
13530
13439
  example: "Monitors website traffic and page load times. Returns {visitors: number, loadTimeMs: number}. Normal: <1000 visitors/min, Surge: >3000. Tighten from 5min to 30s during surge."
13531
- }),
13532
- baselineCron: external_exports.string().optional().refine((val) => !val || validateCronExpression2(val), { message: "Invalid cron expression. Use standard 5-field format (minute hour day month weekday)" }),
13533
- baselineIntervalMs: external_exports.number().int().positive().optional(),
13534
- minIntervalMs: external_exports.number().int().positive().optional(),
13535
- maxIntervalMs: external_exports.number().int().positive().optional(),
13536
- url: external_exports.string().url(),
13537
- method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).default("GET"),
13538
- headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional(),
13539
- bodyJson: external_exports.any().optional(),
13540
- timeoutMs: external_exports.number().int().positive().optional(),
13440
+ }).describe("Endpoint-specific context: what it does, response schema, thresholds, coordination logic"),
13441
+ baselineCron: external_exports.string().optional().refine((val) => !val || validateCronExpression2(val), { message: "Invalid cron expression. Use standard 5-field format (minute hour day month weekday)" }).describe("Baseline cron expression (standard 5-field format)"),
13442
+ baselineIntervalMs: external_exports.number().int().positive().optional().describe("Baseline interval in milliseconds"),
13443
+ minIntervalMs: external_exports.number().int().positive().optional().describe("Minimum interval in milliseconds"),
13444
+ maxIntervalMs: external_exports.number().int().positive().optional().describe("Maximum interval in milliseconds"),
13445
+ url: external_exports.string().url().describe("HTTP endpoint URL"),
13446
+ method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).default("GET").describe("HTTP method"),
13447
+ headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("HTTP headers as key-value pairs"),
13448
+ bodyJson: external_exports.any().optional().describe("Request body (JSON)"),
13449
+ timeoutMs: external_exports.number().int().positive().optional().describe("Request timeout in milliseconds"),
13541
13450
  maxExecutionTimeMs: external_exports.number().int().positive().max(18e5).optional().openapi({
13542
13451
  description: "Maximum expected execution time in milliseconds (for lock duration). Default: 60000 (1 minute). Max: 1800000 (30 minutes).",
13543
13452
  example: 12e4
13544
- }),
13545
- maxResponseSizeKb: external_exports.number().int().positive().optional()
13453
+ }).describe("Maximum expected execution time in milliseconds (for lock duration). Default: 60000 (1 minute). Max: 1800000 (30 minutes)."),
13454
+ maxResponseSizeKb: external_exports.number().int().positive().optional().describe("Maximum response size in kilobytes")
13546
13455
  });
13547
13456
  var EndpointFieldsSchema = EndpointFieldsBaseSchema2.refine((data) => !data.minIntervalMs || !data.maxIntervalMs || data.minIntervalMs <= data.maxIntervalMs, {
13548
13457
  message: "minIntervalMs must be less than or equal to maxIntervalMs",
@@ -13560,77 +13469,223 @@ var UpdateEndpointRequestSchema = EndpointFieldsBaseSchema2.partial().refine((da
13560
13469
  path: ["minIntervalMs"]
13561
13470
  });
13562
13471
  var EndpointResponseSchema = external_exports.object({
13563
- id: external_exports.string(),
13564
- jobId: external_exports.string().optional(),
13565
- name: external_exports.string(),
13566
- description: external_exports.string().optional(),
13567
- baselineCron: external_exports.string().optional(),
13568
- baselineIntervalMs: external_exports.number().optional(),
13569
- minIntervalMs: external_exports.number().optional(),
13570
- maxIntervalMs: external_exports.number().optional(),
13571
- nextRunAt: external_exports.string().datetime(),
13572
- lastRunAt: external_exports.string().datetime().optional(),
13573
- failureCount: external_exports.number().int(),
13574
- pausedUntil: external_exports.string().datetime().optional(),
13575
- url: external_exports.string().optional(),
13576
- method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
13577
- headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional(),
13578
- bodyJson: external_exports.any().optional(),
13579
- timeoutMs: external_exports.number().optional(),
13580
- maxExecutionTimeMs: external_exports.number().optional(),
13581
- maxResponseSizeKb: external_exports.number().optional(),
13472
+ id: external_exports.string().describe("Endpoint ID"),
13473
+ jobId: external_exports.string().optional().describe("Parent job ID"),
13474
+ name: external_exports.string().describe("Endpoint name"),
13475
+ description: external_exports.string().optional().describe("Endpoint description"),
13476
+ baselineCron: external_exports.string().optional().describe("Baseline cron expression"),
13477
+ baselineIntervalMs: external_exports.number().optional().describe("Baseline interval in milliseconds"),
13478
+ minIntervalMs: external_exports.number().optional().describe("Minimum interval in milliseconds"),
13479
+ maxIntervalMs: external_exports.number().optional().describe("Maximum interval in milliseconds"),
13480
+ nextRunAt: external_exports.string().datetime().describe("Next scheduled run time"),
13481
+ lastRunAt: external_exports.string().datetime().optional().describe("Last run time"),
13482
+ failureCount: external_exports.number().int().describe("Consecutive failure count"),
13483
+ pausedUntil: external_exports.string().datetime().optional().describe("Pause expiration time"),
13484
+ url: external_exports.string().optional().describe("HTTP endpoint URL"),
13485
+ method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional().describe("HTTP method"),
13486
+ headersJson: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("HTTP headers"),
13487
+ bodyJson: external_exports.any().optional().describe("Request body"),
13488
+ timeoutMs: external_exports.number().optional().describe("Request timeout in milliseconds"),
13489
+ maxExecutionTimeMs: external_exports.number().optional().describe("Maximum execution time in milliseconds"),
13490
+ maxResponseSizeKb: external_exports.number().optional().describe("Maximum response size in kilobytes"),
13582
13491
  aiHintIntervalMs: external_exports.number().int().optional().openapi({
13583
13492
  description: "AI-suggested interval in milliseconds. If both interval and one-shot hints are active, the earliest scheduled time wins."
13584
- }),
13493
+ }).describe("AI-suggested interval in milliseconds. If both interval and one-shot hints are active, the earliest scheduled time wins."),
13585
13494
  aiHintNextRunAt: external_exports.string().datetime().optional().openapi({
13586
13495
  description: "AI-suggested next run time (one-shot). If both interval and one-shot hints are active, the earliest scheduled time wins."
13587
- }),
13496
+ }).describe("AI-suggested next run time (one-shot). If both interval and one-shot hints are active, the earliest scheduled time wins."),
13588
13497
  aiHintExpiresAt: external_exports.string().datetime().optional().openapi({
13589
13498
  description: "When the AI hint expires"
13590
- }),
13499
+ }).describe("When the AI hint expires"),
13591
13500
  aiHintReason: external_exports.string().optional().openapi({
13592
13501
  description: "Reason for AI hint"
13593
- })
13502
+ }).describe("Reason for AI hint")
13594
13503
  });
13504
+ var ApplyIntervalHintSummary = "Apply interval hint";
13505
+ var ApplyIntervalHintDescription = "Apply an AI-suggested interval adjustment to an endpoint. The hint will override the baseline schedule until it expires. Useful for dynamic scaling based on traffic patterns, errors, or other signals.";
13506
+ var ScheduleOneShotSummary = "Schedule one-shot run";
13507
+ var ScheduleOneShotDescription = "Schedule a one-time run at a specific time or after a delay. Provide either nextRunAt (ISO datetime) or nextRunInMs (delay in ms). Useful for immediate checks or scheduled interventions.";
13508
+ var PauseResumeSummary = "Pause/resume endpoint";
13509
+ var PauseResumeDescription = "Pause an endpoint until a specific time or resume it immediately. Set pausedUntil to an ISO datetime to pause, or null to resume. Useful for maintenance windows or temporary disabling.";
13510
+ var ClearHintsSummary = "Clear AI hints";
13511
+ var ClearHintsDescription = "Clear all AI hints (interval and one-shot) for an endpoint. The endpoint will revert to its baseline schedule. Useful for resetting adaptive behavior.";
13512
+ var ResetFailuresSummary = "Reset failure count";
13513
+ var ResetFailuresDescription = "Reset the failure count for an endpoint to zero. Useful after fixing an issue or to clear accumulated failures that may trigger alerts or backoff behavior.";
13514
+ var ListRunsSummary = "List endpoint runs";
13515
+ var ListRunsDescription = "List run history for an endpoint. Supports filtering by status and pagination with limit/offset. Returns run summaries with execution details.";
13516
+ var GetRunDetailsSummary = "Get run details";
13517
+ var GetRunDetailsDescription = "Get detailed information about a specific run. Includes full execution details, error messages, response body (if available), status code, and endpoint context.";
13518
+ var GetHealthSummarySummary = "Get endpoint health";
13519
+ var GetHealthSummaryDescription = "Get health summary for an endpoint. Returns success/failure counts, average duration, last run info, and current failure streak. Useful for monitoring and alerting.";
13595
13520
  var RunDetailsResponseSchema = external_exports.object({
13596
- id: external_exports.string(),
13597
- endpointId: external_exports.string(),
13598
- status: external_exports.string(),
13599
- startedAt: external_exports.string().datetime(),
13600
- finishedAt: external_exports.string().datetime().optional(),
13601
- durationMs: external_exports.number().optional(),
13602
- errorMessage: external_exports.string().optional(),
13603
- source: external_exports.string().optional(),
13604
- attempt: external_exports.number().int(),
13521
+ id: external_exports.string().describe("Run ID"),
13522
+ endpointId: external_exports.string().describe("Endpoint ID"),
13523
+ status: external_exports.string().describe("Run status"),
13524
+ startedAt: external_exports.string().datetime().describe("Run start time"),
13525
+ finishedAt: external_exports.string().datetime().optional().describe("Run finish time"),
13526
+ durationMs: external_exports.number().optional().describe("Execution duration in milliseconds"),
13527
+ errorMessage: external_exports.string().optional().describe("Error message if run failed"),
13528
+ source: external_exports.string().optional().describe("Scheduling source that triggered this run"),
13529
+ attempt: external_exports.number().int().describe("Execution attempt number"),
13605
13530
  responseBody: external_exports.any().nullable().optional().openapi({
13606
13531
  description: "Response body from endpoint execution (if JSON and within size limit)"
13607
- }),
13532
+ }).describe("Response body from endpoint execution (if JSON and within size limit)"),
13608
13533
  statusCode: external_exports.number().int().optional().openapi({
13609
13534
  description: "HTTP status code from endpoint response"
13610
- }),
13535
+ }).describe("HTTP status code from endpoint response"),
13611
13536
  endpoint: external_exports.object({
13612
- id: external_exports.string(),
13613
- name: external_exports.string(),
13614
- url: external_exports.string().optional(),
13615
- method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional()
13537
+ id: external_exports.string().describe("Endpoint ID"),
13538
+ name: external_exports.string().describe("Endpoint name"),
13539
+ url: external_exports.string().optional().describe("Endpoint URL"),
13540
+ method: external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional().describe("HTTP method")
13616
13541
  }).optional().openapi({
13617
13542
  description: "Endpoint details for debugging"
13618
- })
13543
+ }).describe("Endpoint details for debugging")
13619
13544
  });
13620
13545
 
13621
13546
  // ../../packages/api-contracts/dist/jobs/types.js
13622
13547
  init_esm_shims();
13623
13548
 
13549
+ // src/tools/helpers/index.ts
13550
+ init_esm_shims();
13551
+
13552
+ // src/tools/helpers/api-tool.ts
13553
+ init_esm_shims();
13554
+ function createErrorResponse(error) {
13555
+ if (error instanceof ApiError) {
13556
+ return {
13557
+ content: [
13558
+ {
13559
+ type: "text",
13560
+ text: `API Error (${error.statusCode}): ${error.message}`
13561
+ }
13562
+ ],
13563
+ isError: true
13564
+ };
13565
+ }
13566
+ const message = error instanceof Error ? error.message : String(error);
13567
+ return {
13568
+ content: [
13569
+ {
13570
+ type: "text",
13571
+ text: `Error: ${message}`
13572
+ }
13573
+ ],
13574
+ isError: true
13575
+ };
13576
+ }
13577
+ function createSuccessResponse(output, message) {
13578
+ return {
13579
+ content: [
13580
+ {
13581
+ type: "text",
13582
+ text: message || "\u2705 Operation successful"
13583
+ }
13584
+ ],
13585
+ structuredContent: output
13586
+ };
13587
+ }
13588
+ function registerApiTool(server, apiClient, config) {
13589
+ server.registerTool(
13590
+ config.name,
13591
+ {
13592
+ title: config.title,
13593
+ description: config.description,
13594
+ inputSchema: config.inputSchema,
13595
+ outputSchema: config.outputSchema
13596
+ },
13597
+ async (params) => {
13598
+ try {
13599
+ const validatedInput = config.inputValidator.parse(params);
13600
+ const path4 = typeof config.path === "function" ? config.path(validatedInput) : config.path;
13601
+ const body = config.transformInput ? config.transformInput(validatedInput) : validatedInput;
13602
+ const requestOptions = {
13603
+ method: config.method
13604
+ };
13605
+ if (["POST", "PATCH", "PUT"].includes(config.method)) {
13606
+ requestOptions.body = JSON.stringify(body);
13607
+ }
13608
+ const response = await apiClient.fetch(path4, requestOptions);
13609
+ const validatedResponse = config.outputValidator.parse(response);
13610
+ const message = config.successMessage ? config.successMessage(validatedResponse) : void 0;
13611
+ return createSuccessResponse(validatedResponse, message);
13612
+ } catch (error) {
13613
+ return createErrorResponse(error);
13614
+ }
13615
+ }
13616
+ );
13617
+ }
13618
+
13619
+ // src/tools/helpers/schema-utils.ts
13620
+ init_esm_shims();
13621
+ function toShape(schema) {
13622
+ if (schema instanceof external_exports.ZodIntersection) {
13623
+ const left = toShape(schema._def.left);
13624
+ const right = toShape(schema._def.right);
13625
+ return { ...left, ...right };
13626
+ }
13627
+ if (schema instanceof external_exports.ZodEffects) {
13628
+ return toShape(schema._def.schema);
13629
+ }
13630
+ if (schema instanceof external_exports.ZodObject) {
13631
+ return schema.shape;
13632
+ }
13633
+ return {};
13634
+ }
13635
+
13636
+ // src/tools/api/delete-endpoint.ts
13637
+ var DeleteEndpointRequestSchema = external_exports.object({
13638
+ jobId: external_exports.string().describe("Parent job ID"),
13639
+ id: external_exports.string().describe("Endpoint ID to delete")
13640
+ });
13641
+ var EmptyResponseSchema = external_exports.object({});
13642
+ function registerDeleteEndpoint(server, apiClient) {
13643
+ registerApiTool(server, apiClient, {
13644
+ name: "deleteEndpoint",
13645
+ title: DeleteEndpointSummary,
13646
+ description: DeleteEndpointDescription,
13647
+ inputSchema: toShape(DeleteEndpointRequestSchema),
13648
+ outputSchema: toShape(EmptyResponseSchema),
13649
+ inputValidator: DeleteEndpointRequestSchema,
13650
+ outputValidator: EmptyResponseSchema,
13651
+ method: "DELETE",
13652
+ path: (input) => `/jobs/${input.jobId}/endpoints/${input.id}`,
13653
+ successMessage: () => `\u2705 Endpoint deleted successfully`
13654
+ });
13655
+ }
13656
+
13657
+ // src/tools/api/delete-hints.ts
13658
+ init_esm_shims();
13659
+ var DeleteHintsRequestSchema = external_exports.object({
13660
+ id: external_exports.string().describe("Endpoint ID")
13661
+ });
13662
+ var EmptyResponseSchema2 = external_exports.object({});
13663
+ function registerDeleteHints(server, apiClient) {
13664
+ registerApiTool(server, apiClient, {
13665
+ name: "clearHints",
13666
+ title: ClearHintsSummary,
13667
+ description: ClearHintsDescription,
13668
+ inputSchema: toShape(DeleteHintsRequestSchema),
13669
+ outputSchema: toShape(EmptyResponseSchema2),
13670
+ inputValidator: DeleteHintsRequestSchema,
13671
+ outputValidator: EmptyResponseSchema2,
13672
+ method: "DELETE",
13673
+ path: (input) => `/endpoints/${input.id}/hints`,
13674
+ successMessage: () => `\u2705 AI hints cleared successfully`
13675
+ });
13676
+ }
13677
+
13624
13678
  // src/tools/api/delete-job.ts
13679
+ init_esm_shims();
13625
13680
  var DeleteJobRequestSchema = external_exports.object({
13626
13681
  id: external_exports.string().describe("Job ID to archive")
13627
13682
  });
13628
13683
  var JobResponseSchema2 = schemas_base_exports.JobResponseBaseSchema;
13629
13684
  function registerDeleteJob(server, apiClient) {
13630
13685
  registerApiTool(server, apiClient, {
13631
- name: "DELETE_jobs_id",
13632
- title: "Archive Job",
13633
- description: "Archive a job (soft delete). The job status will be set to 'archived' and an archivedAt timestamp will be recorded. Archived jobs can be recovered if needed.",
13686
+ name: "archiveJob",
13687
+ title: ArchiveJobSummary,
13688
+ description: ArchiveJobDescription,
13634
13689
  inputSchema: toShape(DeleteJobRequestSchema),
13635
13690
  outputSchema: toShape(JobResponseSchema2),
13636
13691
  inputValidator: DeleteJobRequestSchema,
@@ -13702,6 +13757,8 @@ var DashboardStatsQueryBaseSchema = external_exports.object({
13702
13757
 
13703
13758
  // ../../packages/api-contracts/dist/dashboard/schemas.js
13704
13759
  init_esm_shims();
13760
+ var GetDashboardStatsSummary = "Get dashboard statistics";
13761
+ var GetDashboardStatsDescription = "Get comprehensive dashboard statistics including job counts, endpoint stats, success rates, recent activity, time-series data, top endpoints, and recent runs. Useful for overview and monitoring.";
13705
13762
  var DashboardStatsResponseSchema = external_exports.object({
13706
13763
  jobs: external_exports.object({
13707
13764
  total: external_exports.number().int().nonnegative().openapi({
@@ -13872,9 +13929,9 @@ var DashboardStatsRequestSchema = schemas_base_exports2.DashboardStatsQueryBaseS
13872
13929
  var DashboardStatsResponseSchema2 = schemas_base_exports2.DashboardStatsResponseBaseSchema;
13873
13930
  function registerGetDashboardStats(server, apiClient) {
13874
13931
  registerApiTool(server, apiClient, {
13875
- name: "GET_dashboard_stats",
13876
- title: "Get Dashboard Statistics",
13877
- description: "Get comprehensive dashboard statistics including job counts, endpoint stats, success rates, recent activity, time-series data, top endpoints, and recent runs. Useful for overview and monitoring.",
13932
+ name: "getDashboardStats",
13933
+ title: GetDashboardStatsSummary,
13934
+ description: GetDashboardStatsDescription,
13878
13935
  inputSchema: toShape(DashboardStatsRequestSchema),
13879
13936
  outputSchema: toShape(DashboardStatsResponseSchema2),
13880
13937
  inputValidator: DashboardStatsRequestSchema,
@@ -13893,9 +13950,9 @@ var HealthSummaryRequestSchema = schemas_base_exports.HealthSummaryQueryBaseSche
13893
13950
  var HealthSummaryResponseSchema = schemas_base_exports.HealthSummaryResponseBaseSchema;
13894
13951
  function registerGetEndpointHealth(server, apiClient) {
13895
13952
  registerApiTool(server, apiClient, {
13896
- name: "GET_endpoints_id_health",
13897
- title: "Get Endpoint Health",
13898
- description: "Get health summary for an endpoint. Returns success/failure counts, average duration, last run info, and current failure streak. Useful for monitoring and alerting.",
13953
+ name: "getEndpointHealth",
13954
+ title: GetHealthSummarySummary,
13955
+ description: GetHealthSummaryDescription,
13899
13956
  inputSchema: toShape(HealthSummaryRequestSchema),
13900
13957
  outputSchema: toShape(HealthSummaryResponseSchema),
13901
13958
  inputValidator: HealthSummaryRequestSchema,
@@ -13918,9 +13975,9 @@ var ListRunsResponseSchema = external_exports.object({
13918
13975
  });
13919
13976
  function registerGetEndpointRuns(server, apiClient) {
13920
13977
  registerApiTool(server, apiClient, {
13921
- name: "GET_endpoints_id_runs",
13922
- title: "List Endpoint Runs",
13923
- description: "List run history for an endpoint. Supports filtering by status and pagination with limit/offset. Returns run summaries with execution details.",
13978
+ name: "listEndpointRuns",
13979
+ title: ListRunsSummary,
13980
+ description: ListRunsDescription,
13924
13981
  inputSchema: toShape(ListRunsRequestSchema),
13925
13982
  outputSchema: toShape(ListRunsResponseSchema),
13926
13983
  inputValidator: ListRunsRequestSchema,
@@ -13940,9 +13997,9 @@ var GetEndpointRequestSchema = external_exports.object({
13940
13997
  var EndpointResponseSchema2 = schemas_base_exports.EndpointResponseBaseSchema;
13941
13998
  function registerGetEndpoint(server, apiClient) {
13942
13999
  registerApiTool(server, apiClient, {
13943
- name: "GET_jobs_jobId_endpoints_id",
13944
- title: "Get Endpoint",
13945
- description: "Retrieve a single endpoint by ID. Returns full configuration including baseline schedule, AI hints, execution settings, and current state.",
14000
+ name: "getEndpoint",
14001
+ title: GetEndpointSummary,
14002
+ description: GetEndpointDescription,
13946
14003
  inputSchema: toShape(GetEndpointRequestSchema),
13947
14004
  outputSchema: toShape(EndpointResponseSchema2),
13948
14005
  inputValidator: GetEndpointRequestSchema,
@@ -13955,15 +14012,12 @@ function registerGetEndpoint(server, apiClient) {
13955
14012
 
13956
14013
  // src/tools/api/get-job.ts
13957
14014
  init_esm_shims();
13958
- var GetJobRequestSchema = external_exports.object({
13959
- id: external_exports.string().describe("Job ID")
13960
- });
13961
14015
  var JobResponseSchema3 = schemas_base_exports.JobResponseBaseSchema;
13962
14016
  function registerGetJob(server, apiClient) {
13963
14017
  registerApiTool(server, apiClient, {
13964
- name: "GET_jobs_id",
13965
- title: "Get Job",
13966
- description: "Retrieve a single job by ID. Returns full job details including status and timestamps.",
14018
+ name: "getJob",
14019
+ title: GetJobSummary,
14020
+ description: GetJobDescription,
13967
14021
  inputSchema: toShape(GetJobRequestSchema),
13968
14022
  outputSchema: toShape(JobResponseSchema3),
13969
14023
  inputValidator: GetJobRequestSchema,
@@ -13982,9 +14036,9 @@ var GetRunDetailsRequestSchema = external_exports.object({
13982
14036
  var RunDetailsResponseSchema2 = schemas_base_exports.RunDetailsResponseBaseSchema;
13983
14037
  function registerGetRunDetails(server, apiClient) {
13984
14038
  registerApiTool(server, apiClient, {
13985
- name: "GET_runs_id",
13986
- title: "Get Run Details",
13987
- description: "Get detailed information about a specific run. Includes full execution details, error messages, response body (if available), status code, and endpoint context.",
14039
+ name: "getRunDetails",
14040
+ title: GetRunDetailsSummary,
14041
+ description: GetRunDetailsDescription,
13988
14042
  inputSchema: toShape(GetRunDetailsRequestSchema),
13989
14043
  outputSchema: toShape(RunDetailsResponseSchema2),
13990
14044
  inputValidator: GetRunDetailsRequestSchema,
@@ -14006,9 +14060,9 @@ var ListEndpointsResponseSchema = external_exports.object({
14006
14060
  });
14007
14061
  function registerListEndpoints(server, apiClient) {
14008
14062
  registerApiTool(server, apiClient, {
14009
- name: "GET_jobs_jobId_endpoints",
14010
- title: "List Endpoints",
14011
- description: "List all endpoints for a job. Returns complete endpoint configurations including schedules, AI hints, and execution settings.",
14063
+ name: "listEndpoints",
14064
+ title: ListEndpointsSummary,
14065
+ description: ListEndpointsDescription,
14012
14066
  inputSchema: toShape(ListEndpointsRequestSchema),
14013
14067
  outputSchema: toShape(ListEndpointsResponseSchema),
14014
14068
  inputValidator: ListEndpointsRequestSchema,
@@ -14030,9 +14084,9 @@ var ListJobsResponseSchema = external_exports.object({
14030
14084
  });
14031
14085
  function registerListJobs(server, apiClient) {
14032
14086
  registerApiTool(server, apiClient, {
14033
- name: "GET_jobs",
14034
- title: "List Jobs",
14035
- description: "List all jobs for the authenticated user. Optionally filter by status (active, paused, archived). Returns jobs with endpoint counts.",
14087
+ name: "listJobs",
14088
+ title: ListJobsSummary,
14089
+ description: ListJobsDescription,
14036
14090
  inputSchema: toShape(ListJobsRequestSchema),
14037
14091
  outputSchema: toShape(ListJobsResponseSchema),
14038
14092
  inputValidator: ListJobsRequestSchema,
@@ -14052,9 +14106,9 @@ var PatchEndpointRequestSchema = schemas_base_exports.UpdateEndpointRequestBaseS
14052
14106
  var EndpointResponseSchema4 = schemas_base_exports.EndpointResponseBaseSchema;
14053
14107
  function registerPatchEndpoint(server, apiClient) {
14054
14108
  registerApiTool(server, apiClient, {
14055
- name: "PATCH_jobs_jobId_endpoints_id",
14056
- title: "Update Endpoint",
14057
- description: "Update endpoint configuration. All fields are optional - only provided fields will be updated.",
14109
+ name: "updateEndpoint",
14110
+ title: UpdateEndpointSummary,
14111
+ description: UpdateEndpointDescription,
14058
14112
  inputSchema: toShape(PatchEndpointRequestSchema),
14059
14113
  outputSchema: toShape(EndpointResponseSchema4),
14060
14114
  inputValidator: PatchEndpointRequestSchema,
@@ -14077,9 +14131,9 @@ var PatchJobRequestSchema = schemas_base_exports.UpdateJobRequestBaseSchema.and(
14077
14131
  var JobResponseSchema4 = schemas_base_exports.JobResponseBaseSchema;
14078
14132
  function registerPatchJob(server, apiClient) {
14079
14133
  registerApiTool(server, apiClient, {
14080
- name: "PATCH_jobs_id",
14081
- title: "Update Job",
14082
- description: "Update job name or description. All fields are optional - only provided fields will be updated.",
14134
+ name: "updateJob",
14135
+ title: UpdateJobSummary,
14136
+ description: UpdateJobDescription,
14083
14137
  inputSchema: toShape(PatchJobRequestSchema),
14084
14138
  outputSchema: toShape(JobResponseSchema4),
14085
14139
  inputValidator: PatchJobRequestSchema,
@@ -14102,9 +14156,9 @@ var PauseResumeRequestSchema = schemas_base_exports.PauseResumeRequestBaseSchema
14102
14156
  var EmptyResponseSchema3 = external_exports.object({});
14103
14157
  function registerPostEndpointPause(server, apiClient) {
14104
14158
  registerApiTool(server, apiClient, {
14105
- name: "POST_endpoints_id_pause",
14106
- title: "Pause/Resume Endpoint",
14107
- description: "Pause an endpoint until a specific time or resume it immediately. Set pausedUntil to an ISO datetime to pause, or null to resume. Useful for maintenance windows or temporary disabling.",
14159
+ name: "pauseResumeEndpoint",
14160
+ title: PauseResumeSummary,
14161
+ description: PauseResumeDescription,
14108
14162
  inputSchema: toShape(PauseResumeRequestSchema),
14109
14163
  outputSchema: toShape(EmptyResponseSchema3),
14110
14164
  inputValidator: PauseResumeRequestSchema,
@@ -14127,9 +14181,9 @@ var AddEndpointRequestSchema2 = schemas_base_exports.AddEndpointRequestBaseSchem
14127
14181
  var EndpointResponseSchema5 = schemas_base_exports.EndpointResponseBaseSchema;
14128
14182
  function registerPostEndpoint(server, apiClient) {
14129
14183
  registerApiTool(server, apiClient, {
14130
- name: "POST_jobs_jobId_endpoints",
14131
- title: "Add Endpoint",
14132
- description: "Add an endpoint to a job. Must provide either baselineCron OR baselineIntervalMs (not both). The endpoint will execute according to the baseline schedule and can be dynamically adjusted with AI hints.",
14184
+ name: "addEndpoint",
14185
+ title: AddEndpointSummary,
14186
+ description: AddEndpointDescription,
14133
14187
  inputSchema: toShape(AddEndpointRequestSchema2),
14134
14188
  outputSchema: toShape(EndpointResponseSchema5),
14135
14189
  inputValidator: AddEndpointRequestSchema2,
@@ -14152,9 +14206,9 @@ var ApplyIntervalHintRequestSchema = schemas_base_exports.ApplyIntervalHintReque
14152
14206
  var EmptyResponseSchema4 = external_exports.object({});
14153
14207
  function registerPostIntervalHint(server, apiClient) {
14154
14208
  registerApiTool(server, apiClient, {
14155
- name: "POST_endpoints_id_hints_interval",
14156
- title: "Apply Interval Hint",
14157
- description: "Apply an AI-suggested interval adjustment to an endpoint. The hint will override the baseline schedule until it expires. Useful for dynamic scaling based on traffic patterns, errors, or other signals.",
14209
+ name: "applyIntervalHint",
14210
+ title: ApplyIntervalHintSummary,
14211
+ description: ApplyIntervalHintDescription,
14158
14212
  inputSchema: toShape(ApplyIntervalHintRequestSchema),
14159
14213
  outputSchema: toShape(EmptyResponseSchema4),
14160
14214
  inputValidator: ApplyIntervalHintRequestSchema,
@@ -14177,9 +14231,9 @@ var PauseJobRequestSchema = external_exports.object({
14177
14231
  var JobResponseSchema5 = schemas_base_exports.JobResponseBaseSchema;
14178
14232
  function registerPauseJob(server, apiClient) {
14179
14233
  registerApiTool(server, apiClient, {
14180
- name: "POST_jobs_id_pause",
14181
- title: "Pause Job",
14182
- description: "Pause a job. The job status will be set to 'paused' and all associated endpoints will stop executing until resumed.",
14234
+ name: "pauseJob",
14235
+ title: PauseJobSummary,
14236
+ description: PauseJobDescription,
14183
14237
  inputSchema: toShape(PauseJobRequestSchema),
14184
14238
  outputSchema: toShape(JobResponseSchema5),
14185
14239
  inputValidator: PauseJobRequestSchema,
@@ -14198,9 +14252,9 @@ var ResumeJobRequestSchema = external_exports.object({
14198
14252
  var JobResponseSchema6 = schemas_base_exports.JobResponseBaseSchema;
14199
14253
  function registerResumeJob(server, apiClient) {
14200
14254
  registerApiTool(server, apiClient, {
14201
- name: "POST_jobs_id_resume",
14202
- title: "Resume Job",
14203
- description: "Resume a paused job. The job status will be set to 'active' and all associated endpoints will resume executing on their schedules.",
14255
+ name: "resumeJob",
14256
+ title: ResumeJobSummary,
14257
+ description: ResumeJobDescription,
14204
14258
  inputSchema: toShape(ResumeJobRequestSchema),
14205
14259
  outputSchema: toShape(JobResponseSchema6),
14206
14260
  inputValidator: ResumeJobRequestSchema,
@@ -14217,9 +14271,9 @@ var CreateJobRequestSchema2 = schemas_base_exports.CreateJobRequestBaseSchema;
14217
14271
  var JobResponseSchema7 = schemas_base_exports.JobResponseBaseSchema;
14218
14272
  function registerPostJobs(server, apiClient) {
14219
14273
  registerApiTool(server, apiClient, {
14220
- name: "POST_jobs",
14221
- title: "Create Job",
14222
- description: "Create a new job. Jobs are containers for endpoints that execute on schedules. After creating a job, use POST_jobs_jobId_endpoints to add executable endpoints.",
14274
+ name: "createJob",
14275
+ title: CreateJobSummary,
14276
+ description: CreateJobDescription,
14223
14277
  inputSchema: toShape(CreateJobRequestSchema2),
14224
14278
  outputSchema: toShape(JobResponseSchema7),
14225
14279
  inputValidator: CreateJobRequestSchema2,
@@ -14238,9 +14292,9 @@ var ScheduleOneShotRequestSchema = schemas_base_exports.ScheduleOneShotRequestBa
14238
14292
  var EmptyResponseSchema5 = external_exports.object({});
14239
14293
  function registerPostOneShotHint(server, apiClient) {
14240
14294
  registerApiTool(server, apiClient, {
14241
- name: "POST_endpoints_id_hints_oneshot",
14242
- title: "Schedule One-Shot Run",
14243
- description: "Schedule a one-time run at a specific time or after a delay. Provide either nextRunAt (ISO datetime) or nextRunInMs (delay in ms). Useful for immediate checks or scheduled interventions.",
14295
+ name: "scheduleOneShot",
14296
+ title: ScheduleOneShotSummary,
14297
+ description: ScheduleOneShotDescription,
14244
14298
  inputSchema: toShape(ScheduleOneShotRequestSchema),
14245
14299
  outputSchema: toShape(EmptyResponseSchema5),
14246
14300
  inputValidator: ScheduleOneShotRequestSchema,
@@ -14263,9 +14317,9 @@ var ResetFailuresRequestSchema = external_exports.object({
14263
14317
  var EmptyResponseSchema6 = external_exports.object({});
14264
14318
  function registerPostResetFailures(server, apiClient) {
14265
14319
  registerApiTool(server, apiClient, {
14266
- name: "POST_endpoints_id_reset_failures",
14267
- title: "Reset Failure Count",
14268
- description: "Reset the failure count for an endpoint to zero. Useful after fixing an issue or to clear accumulated failures that may trigger alerts or backoff behavior.",
14320
+ name: "resetFailures",
14321
+ title: ResetFailuresSummary,
14322
+ description: ResetFailuresDescription,
14269
14323
  inputSchema: toShape(ResetFailuresRequestSchema),
14270
14324
  outputSchema: toShape(EmptyResponseSchema6),
14271
14325
  inputValidator: ResetFailuresRequestSchema,