UNPKG

@takashito/linode-mcp-server

Version:

MCP server for Linode API

467 lines 21.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUserSchema = exports.createUserSchema = exports.listUsersSchema = exports.UserSchema = exports.getAccountNetworkTransferSchema = exports.AccountNetworkTransferSchema = exports.enableManagedServiceSchema = exports.updateAccountSettingsSchema = exports.getAccountSettingsSchema = exports.AccountSettingsSchema = exports.updateOAuthClientThumbnailSchema = exports.getOAuthClientThumbnailSchema = exports.resetOAuthClientSecretSchema = exports.deleteOAuthClientSchema = exports.updateOAuthClientSchema = exports.getOAuthClientSchema = exports.createOAuthClientSchema = exports.listOAuthClientsSchema = exports.OAuthClientSchema = exports.listNotificationsSchema = exports.NotificationSchema = exports.listMaintenancesSchema = exports.MaintenanceSchema = exports.getAccountLoginSchema = exports.listAccountLoginsSchema = exports.AccountLoginSchema = exports.listInvoiceItemsSchema = exports.InvoiceItemSchema = exports.getInvoiceSchema = exports.listInvoicesSchema = exports.InvoiceSchema = exports.markEventAsSeenSchema = exports.markEventAsReadSchema = exports.getEventSchema = exports.listEventsSchema = exports.AccountEventSchema = exports.createProxyTokenSchema = exports.getChildAccountSchema = exports.listChildAccountsSchema = exports.ChildAccountSchema = exports.cancelAccountSchema = exports.getRegionServiceAvailabilitySchema = exports.listServiceAvailabilitySchema = exports.ServiceAvailabilitySchema = exports.acknowledgeAgreementsSchema = exports.listAgreementsSchema = exports.AgreementSchema = exports.updateAccountSchema = exports.getAccountSchema = exports.AccountSchema = void 0; exports.updateUserGrantsSchema = exports.getUserGrantsSchema = exports.UserGrantsSchema = exports.deleteUserSchema = exports.updateUserSchema = void 0; const zod_1 = require("zod"); // Account schemas exports.AccountSchema = zod_1.z.object({ active_since: zod_1.z.string(), address_1: zod_1.z.string(), address_2: zod_1.z.string().optional(), balance: zod_1.z.number(), balances: zod_1.z.object({ uninvoiced: zod_1.z.number(), past_due: zod_1.z.boolean() }), billing_source: zod_1.z.string(), capabilities: zod_1.z.array(zod_1.z.string()), city: zod_1.z.string(), company: zod_1.z.string(), country: zod_1.z.string(), credit_card: zod_1.z.object({ expiry: zod_1.z.string(), last_four: zod_1.z.string() }), email: zod_1.z.string().email(), euuid: zod_1.z.string(), first_name: zod_1.z.string(), last_name: zod_1.z.string(), phone: zod_1.z.string(), state: zod_1.z.string(), tax_id: zod_1.z.string(), zip: zod_1.z.string() }); // Get Account schema exports.getAccountSchema = zod_1.z.object({}); // Update Account schema exports.updateAccountSchema = zod_1.z.object({ address_1: zod_1.z.string().optional().describe('First line of address'), address_2: zod_1.z.string().optional().describe('Second line of address'), city: zod_1.z.string().optional().describe('City'), company: zod_1.z.string().optional().describe('Company name'), country: zod_1.z.string().optional().describe('Country code (e.g., US)'), email: zod_1.z.string().email().optional().describe('Email address'), first_name: zod_1.z.string().optional().describe('First name'), last_name: zod_1.z.string().optional().describe('Last name'), phone: zod_1.z.string().optional().describe('Phone number'), state: zod_1.z.string().optional().describe('State/province code (e.g., CA)'), tax_id: zod_1.z.string().optional().describe('Tax ID'), zip: zod_1.z.string().optional().describe('Zip/postal code') }); // Agreement schemas exports.AgreementSchema = zod_1.z.object({ id: zod_1.z.string(), description: zod_1.z.string(), body: zod_1.z.string(), title: zod_1.z.string(), created: zod_1.z.string(), modified: zod_1.z.string(), expiry: zod_1.z.string().optional(), url: zod_1.z.string().optional() }); // List Agreements schema exports.listAgreementsSchema = zod_1.z.object({}); // Acknowledge Agreements schema exports.acknowledgeAgreementsSchema = zod_1.z.object({ agreement_ids: zod_1.z.array(zod_1.z.string()).describe('List of agreement IDs to acknowledge') }); // Service Availability schemas exports.ServiceAvailabilitySchema = zod_1.z.object({ region: zod_1.z.string(), services: zod_1.z.record(zod_1.z.string(), zod_1.z.boolean()) }); // List Service Availability schema exports.listServiceAvailabilitySchema = zod_1.z.object({}); // Get Region Service Availability schema exports.getRegionServiceAvailabilitySchema = zod_1.z.object({ regionId: zod_1.z.string().describe('ID of the region') }); // Cancel Account schema exports.cancelAccountSchema = zod_1.z.object({ comments: zod_1.z.string().optional().describe('Comments about the reason for cancellation') }); // Child Account schemas exports.ChildAccountSchema = zod_1.z.object({ euuid: zod_1.z.string(), company: zod_1.z.string(), email: zod_1.z.string().email(), is_active: zod_1.z.boolean(), billing_cycle: zod_1.z.string(), state: zod_1.z.string(), has_credit_card: zod_1.z.boolean(), enterprise_data: zod_1.z.object({ credit_limit: zod_1.z.number(), acl: zod_1.z.record(zod_1.z.string(), zod_1.z.string()) }).optional() }); // List Child Accounts schema exports.listChildAccountsSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Get Child Account schema exports.getChildAccountSchema = zod_1.z.object({ euuid: zod_1.z.string().describe('Unique identifier for the child account') }); // Create Proxy Token schema exports.createProxyTokenSchema = zod_1.z.object({ euuid: zod_1.z.string().describe('Unique identifier for the child account'), expiry: zod_1.z.string().optional().describe('Token expiration date in ISO 8601 format'), scopes: zod_1.z.array(zod_1.z.string()).optional().describe('List of API scopes to grant to the token') }); // Event schemas exports.AccountEventSchema = zod_1.z.object({ id: zod_1.z.number(), action: zod_1.z.string(), created: zod_1.z.string(), entity: zod_1.z.object({ id: zod_1.z.number(), label: zod_1.z.string(), type: zod_1.z.string(), url: zod_1.z.string() }), percent_complete: zod_1.z.number().optional(), rate: zod_1.z.string().optional(), read: zod_1.z.boolean(), seen: zod_1.z.boolean(), status: zod_1.z.string(), time_remaining: zod_1.z.number().optional(), username: zod_1.z.string(), message: zod_1.z.string().optional(), secondary_entity: zod_1.z.object({ id: zod_1.z.number(), label: zod_1.z.string(), type: zod_1.z.string(), url: zod_1.z.string() }).optional() }); // List Events schema exports.listEventsSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Get Event schema exports.getEventSchema = zod_1.z.object({ eventId: zod_1.z.number().describe('ID of the event') }); // Mark Event as Read schema exports.markEventAsReadSchema = zod_1.z.object({ eventId: zod_1.z.number().describe('ID of the event') }); // Mark Event as Seen schema exports.markEventAsSeenSchema = zod_1.z.object({ eventId: zod_1.z.number().describe('ID of the event') }); // Invoice schemas exports.InvoiceSchema = zod_1.z.object({ id: zod_1.z.number(), date: zod_1.z.string(), label: zod_1.z.string(), subtotal: zod_1.z.number(), tax: zod_1.z.number(), total: zod_1.z.number() }); // List Invoices schema exports.listInvoicesSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Get Invoice schema exports.getInvoiceSchema = zod_1.z.object({ invoiceId: zod_1.z.number().describe('ID of the invoice') }); // Invoice Item schema exports.InvoiceItemSchema = zod_1.z.object({ amount: zod_1.z.number(), from: zod_1.z.string(), to: zod_1.z.string(), label: zod_1.z.string(), quantity: zod_1.z.number(), type: zod_1.z.string(), unit_price: zod_1.z.string(), tax: zod_1.z.number(), total: zod_1.z.number() }); // List Invoice Items schema exports.listInvoiceItemsSchema = zod_1.z.object({ invoiceId: zod_1.z.number().describe('ID of the invoice'), page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Login schemas exports.AccountLoginSchema = zod_1.z.object({ id: zod_1.z.number(), datetime: zod_1.z.string(), ip: zod_1.z.string(), restricted: zod_1.z.boolean(), status: zod_1.z.string(), username: zod_1.z.string() }); // List Account Logins schema exports.listAccountLoginsSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Get Account Login schema exports.getAccountLoginSchema = zod_1.z.object({ loginId: zod_1.z.number().describe('ID of the login') }); // Maintenance schemas exports.MaintenanceSchema = zod_1.z.object({ when: zod_1.z.string(), entity: zod_1.z.object({ id: zod_1.z.string(), label: zod_1.z.string(), type: zod_1.z.string(), url: zod_1.z.string() }), duration: zod_1.z.number(), status: zod_1.z.string(), type: zod_1.z.string(), reason: zod_1.z.string(), key: zod_1.z.string(), created: zod_1.z.string(), updated: zod_1.z.string() }); // List Maintenances schema exports.listMaintenancesSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Notification schemas exports.NotificationSchema = zod_1.z.object({ body: zod_1.z.string(), entity: zod_1.z.object({ id: zod_1.z.number(), label: zod_1.z.string(), type: zod_1.z.string(), url: zod_1.z.string() }), label: zod_1.z.string(), message: zod_1.z.string(), severity: zod_1.z.string(), type: zod_1.z.string(), until: zod_1.z.string(), when: zod_1.z.string() }); // List Notifications schema exports.listNotificationsSchema = zod_1.z.object({}); // OAuth Client schemas exports.OAuthClientSchema = zod_1.z.object({ id: zod_1.z.string(), label: zod_1.z.string(), redirect_uri: zod_1.z.string(), secret: zod_1.z.string(), public: zod_1.z.boolean(), status: zod_1.z.string(), thumbnail_url: zod_1.z.string().optional() }); // List OAuth Clients schema exports.listOAuthClientsSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Create OAuth Client schema exports.createOAuthClientSchema = zod_1.z.object({ label: zod_1.z.string().describe('A name for the OAuth client'), redirect_uri: zod_1.z.string().describe('The OAuth client callback URL'), public: zod_1.z.boolean().optional().describe('Whether this client is public or not') }); // Get OAuth Client schema exports.getOAuthClientSchema = zod_1.z.object({ clientId: zod_1.z.string().describe('ID of the OAuth client') }); // Update OAuth Client schema exports.updateOAuthClientSchema = zod_1.z.object({ clientId: zod_1.z.string().describe('ID of the OAuth client'), label: zod_1.z.string().optional().describe('A name for the OAuth client'), redirect_uri: zod_1.z.string().optional().describe('The OAuth client callback URL'), public: zod_1.z.boolean().optional().describe('Whether this client is public or not') }); // Delete OAuth Client schema exports.deleteOAuthClientSchema = zod_1.z.object({ clientId: zod_1.z.string().describe('ID of the OAuth client') }); // Reset OAuth Client Secret schema exports.resetOAuthClientSecretSchema = zod_1.z.object({ clientId: zod_1.z.string().describe('ID of the OAuth client') }); // Get OAuth Client Thumbnail schema exports.getOAuthClientThumbnailSchema = zod_1.z.object({ clientId: zod_1.z.string().describe('ID of the OAuth client') }); // Update OAuth Client Thumbnail schema exports.updateOAuthClientThumbnailSchema = zod_1.z.object({ clientId: zod_1.z.string().describe('ID of the OAuth client'), thumbnailData: zod_1.z.any().describe('Binary image data for the thumbnail') }); // Account Settings schemas exports.AccountSettingsSchema = zod_1.z.object({ managed: zod_1.z.boolean(), longview_subscription: zod_1.z.string().nullable(), network_helper: zod_1.z.boolean(), backups_enabled: zod_1.z.boolean(), object_storage: zod_1.z.enum(['active', 'disabled', 'suspended']) }); // Get Account Settings schema exports.getAccountSettingsSchema = zod_1.z.object({}); // Update Account Settings schema exports.updateAccountSettingsSchema = zod_1.z.object({ network_helper: zod_1.z.boolean().optional().describe('Enables automatic IP assignment for newly created Linodes'), backups_enabled: zod_1.z.boolean().optional().describe('Enables automatic backups for all created Linodes') }); // Enable Managed Service schema exports.enableManagedServiceSchema = zod_1.z.object({}); // Account Network Transfer schemas exports.AccountNetworkTransferSchema = zod_1.z.object({ billable: zod_1.z.number(), used: zod_1.z.number(), quota: zod_1.z.number() }); // Get Account Network Transfer schema exports.getAccountNetworkTransferSchema = zod_1.z.object({}); // User schemas exports.UserSchema = zod_1.z.object({ username: zod_1.z.string(), email: zod_1.z.string().email(), restricted: zod_1.z.boolean(), ssh_keys: zod_1.z.array(zod_1.z.string()), two_factor_auth: zod_1.z.boolean() }); // List Users schema exports.listUsersSchema = zod_1.z.object({ page: zod_1.z.number().optional().describe('Page number of results to return'), page_size: zod_1.z.number().optional().describe('Number of results to return per page') }); // Create User schema exports.createUserSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username for the user'), email: zod_1.z.string().email().describe('The email address for the user'), restricted: zod_1.z.boolean().describe('If true, the user has limited access to account features') }); // Get User schema exports.getUserSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user') }); // Update User schema exports.updateUserSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user'), email: zod_1.z.string().email().optional().describe('The email address for the user'), restricted: zod_1.z.boolean().optional().describe('If true, the user has limited access to account features') }); // Delete User schema exports.deleteUserSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user') }); // User Grants schemas exports.UserGrantsSchema = zod_1.z.object({ global: zod_1.z.object({ account_access: zod_1.z.string(), add_domains: zod_1.z.boolean().optional(), add_databases: zod_1.z.boolean().optional(), add_firewalls: zod_1.z.boolean().optional(), add_images: zod_1.z.boolean().optional(), add_linodes: zod_1.z.boolean().optional(), add_longview: zod_1.z.boolean().optional(), add_nodebalancers: zod_1.z.boolean().optional(), add_stackscripts: zod_1.z.boolean().optional(), add_volumes: zod_1.z.boolean().optional(), cancel_account: zod_1.z.boolean().optional(), longview_subscription: zod_1.z.boolean().optional() }), database: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), domain: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), firewall: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), image: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), linode: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), longview: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), nodebalancer: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), stackscript: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })), volume: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.number(), permissions: zod_1.z.string(), label: zod_1.z.string() })) }); // Get User Grants schema exports.getUserGrantsSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user') }); // Update User Grants schema exports.updateUserGrantsSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user'), global: zod_1.z.object({ account_access: zod_1.z.string().optional().describe('The level of access ("read_only" or "read_write")'), add_domains: zod_1.z.boolean().optional().describe('Whether the user can add domains'), add_databases: zod_1.z.boolean().optional().describe('Whether the user can add databases'), add_firewalls: zod_1.z.boolean().optional().describe('Whether the user can add firewalls'), add_images: zod_1.z.boolean().optional().describe('Whether the user can add images'), add_linodes: zod_1.z.boolean().optional().describe('Whether the user can add Linodes'), add_longview: zod_1.z.boolean().optional().describe('Whether the user can add Longview clients'), add_nodebalancers: zod_1.z.boolean().optional().describe('Whether the user can add NodeBalancers'), add_stackscripts: zod_1.z.boolean().optional().describe('Whether the user can add StackScripts'), add_volumes: zod_1.z.boolean().optional().describe('Whether the user can add volumes'), cancel_account: zod_1.z.boolean().optional().describe('Whether the user can cancel the account'), longview_subscription: zod_1.z.boolean().optional().describe('Whether the user can manage the Longview subscription') }).optional(), database: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), domain: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), firewall: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), image: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), linode: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), longview: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), nodebalancer: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), stackscript: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional(), volume: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ permissions: zod_1.z.string().describe('The level of access ("read_only" or "read_write")') })).optional() }); //# sourceMappingURL=schemas.js.map