@takashito/linode-mcp-server
Version:
MCP server for Linode API
149 lines • 9.63 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createServiceTokenSchema = exports.getServiceMetricsSchema = exports.listServiceMetricDefinitionsSchema = exports.listServiceDashboardsSchema = exports.getMonitorServiceSchema = exports.listMonitorServicesSchema = exports.getMonitorDashboardSchema = exports.listMonitorDashboardsSchema = exports.getLogDestinationHistorySchema = exports.deleteLogDestinationSchema = exports.updateLogDestinationSchema = exports.createLogDestinationSchema = exports.getLogDestinationSchema = exports.listLogDestinationsSchema = exports.getLogStreamHistorySchema = exports.deleteLogStreamSchema = exports.updateLogStreamSchema = exports.createLogStreamSchema = exports.getLogStreamSchema = exports.listLogStreamsSchema = exports.deleteAlertDefinitionSchema = exports.updateAlertDefinitionSchema = exports.createAlertDefinitionSchema = exports.getAlertDefinitionSchema = exports.listServiceAlertDefinitionsSchema = exports.listAlertDefinitionsSchema = exports.listChannelAlertsSchema = exports.deleteNotificationChannelSchema = exports.updateNotificationChannelSchema = exports.createNotificationChannelSchema = exports.getNotificationChannelSchema = exports.listNotificationChannelsSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../common/schemas");
// Alert channel schemas
exports.listNotificationChannelsSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getNotificationChannelSchema = zod_1.z.object({
channelId: zod_1.z.coerce.number().describe('The ID of the notification channel')
});
exports.createNotificationChannelSchema = zod_1.z.object({
label: zod_1.z.string().describe('The label for the notification channel'),
channel_type: zod_1.z.string().describe('The type of notification channel (e.g., email, slack, webhook)'),
details: zod_1.z.record(zod_1.z.any()).describe('The channel-specific configuration details. For email: { email: { usernames: [...], email_addresses: [...], recipient_type: "..." } }')
});
exports.updateNotificationChannelSchema = zod_1.z.object({
channelId: zod_1.z.coerce.number().describe('The ID of the notification channel'),
label: zod_1.z.string().optional().describe('The label for the notification channel'),
channel_type: zod_1.z.string().optional().describe('The type of notification channel'),
details: zod_1.z.record(zod_1.z.any()).optional().describe('The channel-specific configuration details')
});
exports.deleteNotificationChannelSchema = zod_1.z.object({
channelId: zod_1.z.coerce.number().describe('The ID of the notification channel')
});
exports.listChannelAlertsSchema = zod_1.z.object({
channelId: zod_1.z.coerce.number().describe('The ID of the notification channel'),
...schemas_1.pagingParamsSchema.shape
});
// Alert definition schemas
exports.listAlertDefinitionsSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.listServiceAlertDefinitionsSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type (e.g., linode, dbaas, lke)'),
...schemas_1.pagingParamsSchema.shape
});
exports.getAlertDefinitionSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type (e.g., linode, dbaas, lke)'),
alertId: zod_1.z.coerce.number().describe('The ID of the alert definition')
});
exports.createAlertDefinitionSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type (e.g., linode, dbaas, lke)'),
label: zod_1.z.string().describe('The label for the alert definition'),
description: zod_1.z.string().optional().describe('A description of the alert definition'),
severity: zod_1.z.coerce.number().optional().describe('The severity level of the alert (0-3)'),
trigger_conditions: zod_1.z.record(zod_1.z.any()).describe('The conditions that trigger the alert'),
channel_ids: zod_1.z.array(zod_1.z.coerce.number()).optional().describe('Array of notification channel IDs'),
entity_ids: zod_1.z.array(zod_1.z.string()).optional().describe('Array of entity IDs to monitor'),
enabled: (0, schemas_1.coerceBoolean)().optional().describe('Whether the alert definition is enabled')
});
exports.updateAlertDefinitionSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type (e.g., linode, dbaas, lke)'),
alertId: zod_1.z.coerce.number().describe('The ID of the alert definition'),
label: zod_1.z.string().optional().describe('The label for the alert definition'),
description: zod_1.z.string().optional().describe('A description of the alert definition'),
severity: zod_1.z.coerce.number().optional().describe('The severity level of the alert (0-3)'),
trigger_conditions: zod_1.z.record(zod_1.z.any()).optional().describe('The conditions that trigger the alert'),
channel_ids: zod_1.z.array(zod_1.z.coerce.number()).optional().describe('Array of notification channel IDs'),
entity_ids: zod_1.z.array(zod_1.z.string()).optional().describe('Array of entity IDs to monitor'),
enabled: (0, schemas_1.coerceBoolean)().optional().describe('Whether the alert definition is enabled')
});
exports.deleteAlertDefinitionSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type (e.g., linode, dbaas, lke)'),
alertId: zod_1.z.coerce.number().describe('The ID of the alert definition')
});
// Log stream schemas
exports.listLogStreamsSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getLogStreamSchema = zod_1.z.object({
streamId: zod_1.z.coerce.number().describe('The ID of the log stream')
});
exports.createLogStreamSchema = zod_1.z.object({
label: zod_1.z.string().describe('The label for the log stream'),
filters: zod_1.z.record(zod_1.z.any()).describe('The filters configuration for the log stream'),
aggregation: zod_1.z.record(zod_1.z.any()).describe('The aggregation configuration for the log stream')
});
exports.updateLogStreamSchema = zod_1.z.object({
streamId: zod_1.z.coerce.number().describe('The ID of the log stream to update'),
label: zod_1.z.string().optional().describe('The label for the log stream'),
filters: zod_1.z.record(zod_1.z.any()).optional().describe('The filters configuration'),
aggregation: zod_1.z.record(zod_1.z.any()).optional().describe('The aggregation configuration')
});
exports.deleteLogStreamSchema = zod_1.z.object({
streamId: zod_1.z.coerce.number().describe('The ID of the log stream to delete')
});
exports.getLogStreamHistorySchema = zod_1.z.object({
streamId: zod_1.z.coerce.number().describe('The ID of the log stream'),
...schemas_1.pagingParamsSchema.shape
});
// Log destination schemas
exports.listLogDestinationsSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getLogDestinationSchema = zod_1.z.object({
destinationId: zod_1.z.coerce.number().describe('The ID of the log destination')
});
exports.createLogDestinationSchema = zod_1.z.object({
label: zod_1.z.string().describe('The label for the log destination'),
type: zod_1.z.string().describe('The type of the log destination'),
config: zod_1.z.record(zod_1.z.any()).describe('The configuration for the log destination')
});
exports.updateLogDestinationSchema = zod_1.z.object({
destinationId: zod_1.z.coerce.number().describe('The ID of the log destination to update'),
label: zod_1.z.string().optional().describe('The label for the log destination'),
type: zod_1.z.string().optional().describe('The type of the log destination'),
config: zod_1.z.record(zod_1.z.any()).optional().describe('The configuration for the log destination')
});
exports.deleteLogDestinationSchema = zod_1.z.object({
destinationId: zod_1.z.coerce.number().describe('The ID of the log destination to delete')
});
exports.getLogDestinationHistorySchema = zod_1.z.object({
destinationId: zod_1.z.coerce.number().describe('The ID of the log destination'),
...schemas_1.pagingParamsSchema.shape
});
// Dashboard schemas
exports.listMonitorDashboardsSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getMonitorDashboardSchema = zod_1.z.object({
dashboardId: zod_1.z.coerce.number().describe('The ID of the dashboard')
});
// Service & metrics schemas
exports.listMonitorServicesSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getMonitorServiceSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type to get details for')
});
exports.listServiceDashboardsSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type to list dashboards for'),
...schemas_1.pagingParamsSchema.shape
});
exports.listServiceMetricDefinitionsSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type to list metric definitions for')
});
exports.getServiceMetricsSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type to get metrics for'),
entity_ids: zod_1.z.array(zod_1.z.coerce.number()).describe('Array of entity IDs to get metrics for'),
start_time: zod_1.z.string().describe('The start time in ISO 8601 format'),
end_time: zod_1.z.string().describe('The end time in ISO 8601 format'),
time_granularity: zod_1.z.record(zod_1.z.any()).optional().describe('The time granularity for the metrics data')
});
exports.createServiceTokenSchema = zod_1.z.object({
serviceType: zod_1.z.string().describe('The service type to create a token for')
});
//# sourceMappingURL=schemas.js.map