@takashito/linode-mcp-server
Version:
MCP server for Linode API
71 lines • 2.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.actionSchema = exports.statusSchema = exports.idSchema = exports.dateSchema = exports.cidrSchema = exports.ipAddressStringSchema = exports.imageSchema = exports.regionSchema = exports.tagSchema = exports.tagsSchema = exports.paginatedResponseSchema = exports.pagingParamsSchema = exports.paginationSchema = void 0;
const zod_1 = require("zod");
// Common schema definitions used across multiple tools
// Pagination schema for list endpoints
exports.paginationSchema = zod_1.z.object({
page: zod_1.z.number().int().optional().describe('Page number to fetch (minimum: 1)'),
page_size: zod_1.z.number().int().optional().describe('Number of items per page (minimum: 1, maximum: 500)')
});
// For backward compatibility
exports.pagingParamsSchema = exports.paginationSchema;
// For paginated response
const paginatedResponseSchema = (schema) => zod_1.z.object({
data: zod_1.z.array(schema),
page: zod_1.z.number(),
pages: zod_1.z.number(),
results: zod_1.z.number()
});
exports.paginatedResponseSchema = paginatedResponseSchema;
// Tags schema used in many resources
exports.tagsSchema = zod_1.z.array(zod_1.z.string()).optional()
.describe('Array of user-defined tags for organization. Each tag can be up to 50 characters');
// For backward compatibility
exports.tagSchema = exports.tagsSchema;
// Region schema used in many resources
exports.regionSchema = zod_1.z.string()
.describe('Region where the resource will be created (e.g. us-east, ap-south)');
// Image schema for instances
exports.imageSchema = zod_1.z.string()
.describe('The image to deploy the instance from (e.g. linode/debian11)');
// Simple IP address schema (string only, not the complex object)
exports.ipAddressStringSchema = zod_1.z.string().ip()
.describe('A valid IPv4 or IPv6 address');
// CIDR block schema
exports.cidrSchema = zod_1.z.string()
.describe('A CIDR block notation (e.g. 10.0.0.0/24 or 2001:db8::/64)');
// Date schema
exports.dateSchema = zod_1.z.string().datetime()
.describe('ISO-8601 formatted date-time string');
// ID schema - can be number or string depending on resource
exports.idSchema = zod_1.z.union([zod_1.z.number().int(), zod_1.z.string()])
.describe('Unique identifier for the resource');
// Common status values
exports.statusSchema = zod_1.z.enum([
'active',
'creating',
'deleting',
'disabled',
'failed',
'pending',
'provisioning',
'rebooting',
'rebuilding',
'resizing',
'stopped',
'stopping'
]).describe('Current status of the resource');
// Common actions
exports.actionSchema = zod_1.z.enum([
'boot',
'reboot',
'shutdown',
'power_on',
'power_off',
'resize',
'rebuild',
'restore',
'migrate'
]).describe('Action to perform on the resource');
//# sourceMappingURL=schemas.js.map