UNPKG

@takashito/linode-mcp-server

Version:

MCP server for Linode API

516 lines 25.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUserGrantsSchema = exports.UserGrantsSchema = exports.deleteUserSchema = exports.updateUserSchema = 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.getEventSchema = exports.listEventsSchema = exports.AccountEventSchema = 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.deleteResourceLockSchema = exports.createResourceLockSchema = exports.getResourceLockSchema = exports.listResourceLocksSchema = exports.listMaintenancePoliciesSchema = exports.getUserDelegationsSchema = exports.createDelegationTokenSchema = exports.getDelegationProfileAccountSchema = exports.listDelegationProfileAccountsSchema = exports.updateDelegationDefaultRolesSchema = exports.getDelegationDefaultRolesSchema = exports.updateDelegationChildAccountUsersSchema = exports.getDelegationChildAccountUsersSchema = exports.listDelegationChildAccountsSchema = exports.updateUserRolePermissionsSchema = exports.getUserRolePermissionsSchema = exports.listIamRolesSchema = exports.listEntitiesSchema = void 0; const zod_1 = require("zod"); const schemas_1 = require("../common/schemas"); // 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.coerce.number(), balances: zod_1.z.object({ uninvoiced: zod_1.z.coerce.number(), past_due: (0, schemas_1.coerceBoolean)() }), 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(), (0, schemas_1.coerceBoolean)()) }); // 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: (0, schemas_1.coerceBoolean)(), billing_cycle: zod_1.z.string(), state: zod_1.z.string(), has_credit_card: (0, schemas_1.coerceBoolean)(), enterprise_data: zod_1.z.object({ credit_limit: zod_1.z.coerce.number(), acl: zod_1.z.record(zod_1.z.string(), zod_1.z.string()) }).optional() }); // Event schemas exports.AccountEventSchema = zod_1.z.object({ id: zod_1.z.coerce.number(), action: zod_1.z.string(), created: zod_1.z.string(), entity: zod_1.z.object({ id: zod_1.z.coerce.number(), label: zod_1.z.string(), type: zod_1.z.string(), url: zod_1.z.string() }), percent_complete: zod_1.z.coerce.number().optional(), rate: zod_1.z.string().optional(), read: (0, schemas_1.coerceBoolean)(), seen: (0, schemas_1.coerceBoolean)(), status: zod_1.z.string(), time_remaining: zod_1.z.coerce.number().optional(), username: zod_1.z.string(), message: zod_1.z.string().optional(), secondary_entity: zod_1.z.object({ id: zod_1.z.coerce.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.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); // Get Event schema exports.getEventSchema = zod_1.z.object({ eventId: zod_1.z.coerce.number().describe('ID of the event') }); // Mark Event as Seen schema exports.markEventAsSeenSchema = zod_1.z.object({ eventId: zod_1.z.coerce.number().describe('ID of the event') }); // Invoice schemas exports.InvoiceSchema = zod_1.z.object({ id: zod_1.z.coerce.number(), date: zod_1.z.string(), label: zod_1.z.string(), subtotal: zod_1.z.coerce.number(), tax: zod_1.z.coerce.number(), total: zod_1.z.coerce.number() }); // List Invoices schema exports.listInvoicesSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); // Get Invoice schema exports.getInvoiceSchema = zod_1.z.object({ invoiceId: zod_1.z.coerce.number().describe('ID of the invoice') }); // Invoice Item schema exports.InvoiceItemSchema = zod_1.z.object({ amount: zod_1.z.coerce.number(), from: zod_1.z.string(), to: zod_1.z.string(), label: zod_1.z.string(), quantity: zod_1.z.coerce.number(), type: zod_1.z.string(), unit_price: zod_1.z.string(), tax: zod_1.z.coerce.number(), total: zod_1.z.coerce.number() }); // List Invoice Items schema exports.listInvoiceItemsSchema = zod_1.z.object({ invoiceId: zod_1.z.coerce.number().describe('ID of the invoice'), page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); // Login schemas exports.AccountLoginSchema = zod_1.z.object({ id: zod_1.z.coerce.number(), datetime: zod_1.z.string(), ip: zod_1.z.string(), restricted: (0, schemas_1.coerceBoolean)(), status: zod_1.z.string(), username: zod_1.z.string() }); // List Account Logins schema exports.listAccountLoginsSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); // Get Account Login schema exports.getAccountLoginSchema = zod_1.z.object({ loginId: zod_1.z.coerce.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.coerce.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.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.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.coerce.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: (0, schemas_1.coerceBoolean)(), 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.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.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: (0, schemas_1.coerceBoolean)().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: (0, schemas_1.coerceBoolean)().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: (0, schemas_1.coerceBoolean)(), longview_subscription: zod_1.z.string().nullable(), network_helper: (0, schemas_1.coerceBoolean)(), backups_enabled: (0, schemas_1.coerceBoolean)(), 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: (0, schemas_1.coerceBoolean)().optional().describe('Enables automatic IP assignment for newly created Linodes'), backups_enabled: (0, schemas_1.coerceBoolean)().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.coerce.number(), used: zod_1.z.coerce.number(), quota: zod_1.z.coerce.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: (0, schemas_1.coerceBoolean)(), ssh_keys: zod_1.z.array(zod_1.z.string()), two_factor_auth: (0, schemas_1.coerceBoolean)() }); // List Users schema exports.listUsersSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.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: (0, schemas_1.coerceBoolean)().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: (0, schemas_1.coerceBoolean)().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: (0, schemas_1.coerceBoolean)().optional(), add_databases: (0, schemas_1.coerceBoolean)().optional(), add_firewalls: (0, schemas_1.coerceBoolean)().optional(), add_images: (0, schemas_1.coerceBoolean)().optional(), add_linodes: (0, schemas_1.coerceBoolean)().optional(), add_longview: (0, schemas_1.coerceBoolean)().optional(), add_nodebalancers: (0, schemas_1.coerceBoolean)().optional(), add_stackscripts: (0, schemas_1.coerceBoolean)().optional(), add_volumes: (0, schemas_1.coerceBoolean)().optional(), cancel_account: (0, schemas_1.coerceBoolean)().optional(), longview_subscription: (0, schemas_1.coerceBoolean)().optional() }), database: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.coerce.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.coerce.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.coerce.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.coerce.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.coerce.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.coerce.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.coerce.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.coerce.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.coerce.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') }); // Entity schemas exports.listEntitiesSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); // IAM Role Permission schemas exports.listIamRolesSchema = zod_1.z.object({}); exports.getUserRolePermissionsSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user') }); exports.updateUserRolePermissionsSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user'), roles: zod_1.z.array(zod_1.z.string()).describe('List of role names to assign to the user') }); // Delegation Child Account schemas exports.listDelegationChildAccountsSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); exports.getDelegationChildAccountUsersSchema = zod_1.z.object({ euuid: zod_1.z.string().describe('Unique identifier for the child account') }); exports.updateDelegationChildAccountUsersSchema = zod_1.z.object({ euuid: zod_1.z.string().describe('Unique identifier for the child account'), users: zod_1.z.array(zod_1.z.string()).describe('List of usernames to delegate to the child account') }); // Delegation Default Roles schemas exports.getDelegationDefaultRolesSchema = zod_1.z.object({}); exports.updateDelegationDefaultRolesSchema = zod_1.z.object({ roles: zod_1.z.array(zod_1.z.string()).describe('List of default role names for delegate users') }); // Delegation Profile schemas exports.listDelegationProfileAccountsSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); exports.getDelegationProfileAccountSchema = zod_1.z.object({ euuid: zod_1.z.string().describe('Unique identifier for the child account') }); exports.createDelegationTokenSchema = zod_1.z.object({ euuid: zod_1.z.string().describe('Unique identifier for the child account') }); // User Delegations schema exports.getUserDelegationsSchema = zod_1.z.object({ username: zod_1.z.string().describe('The username of the user') }); // Maintenance Policy schemas exports.listMaintenancePoliciesSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); // Resource Lock schemas exports.listResourceLocksSchema = zod_1.z.object({ page: zod_1.z.coerce.number().optional().describe('Page number of results to return'), page_size: zod_1.z.coerce.number().optional().describe('Number of results to return per page') }); exports.getResourceLockSchema = zod_1.z.object({ resourceLockId: zod_1.z.coerce.number().describe('ID of the resource lock') }); exports.createResourceLockSchema = zod_1.z.object({ resource_id: zod_1.z.coerce.number().describe('ID of the resource to lock'), resource_type: zod_1.z.string().describe('Type of the resource to lock'), reason: zod_1.z.string().optional().describe('Reason for locking the resource') }); exports.deleteResourceLockSchema = zod_1.z.object({ resourceLockId: zod_1.z.coerce.number().describe('ID of the resource lock') }); // 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: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add domains'), add_databases: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add databases'), add_firewalls: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add firewalls'), add_images: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add images'), add_linodes: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add Linodes'), add_longview: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add Longview clients'), add_nodebalancers: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add NodeBalancers'), add_stackscripts: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add StackScripts'), add_volumes: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can add volumes'), cancel_account: (0, schemas_1.coerceBoolean)().optional().describe('Whether the user can cancel the account'), longview_subscription: (0, schemas_1.coerceBoolean)().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