rezdy_agent_configure
Configure Rezdy Agent API access with your API key and environment to enable travel product search, booking, and payment processing.
Instructions
Configure Rezdy Agent API connection with API key and environment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | Yes | Rezdy Agent API key | |
| environment | No | API environment (production or staging) | production |
Implementation Reference
- src/index.ts:490-517 (handler)The handleConfigure function executes the rezdy_agent_configure tool logic. It merges args with environment variables, validates the config using RezdyAgentConfigSchema, instantiates the RezdyAgentClient, and returns a success message.
private async handleConfigure(args: any) { // Allow configuration from environment variables if not provided in args const configData = { apiKey: args.apiKey || process.env.REZDY_API_KEY, environment: args.environment || process.env.REZDY_ENVIRONMENT || 'production', baseUrl: process.env.REZDY_BASE_URL, stagingUrl: process.env.REZDY_STAGING_URL, }; // Remove undefined values Object.keys(configData).forEach(key => { if (configData[key as keyof typeof configData] === undefined) { delete configData[key as keyof typeof configData]; } }); const config = RezdyAgentConfigSchema.parse(configData); this.rezdyClient = new RezdyAgentClient(config); return { content: [ { type: 'text', text: `Rezdy Agent API configured successfully for ${config.environment} environment`, }, ], }; } - src/types.ts:3-10 (schema)RezdyAgentConfigSchema Zod validation schema that defines and validates the configuration input: apiKey (required string), baseUrl/stagingUrl (with defaults), and environment (production/staging enum).
export const RezdyAgentConfigSchema = z.object({ apiKey: z.string(), baseUrl: z.string().default('https://api.rezdy.com/v1'), stagingUrl: z.string().default('https://api-staging.rezdy.com/v1'), environment: z.enum(['production', 'staging']).default('production'), }); export type RezdyAgentConfig = z.infer<typeof RezdyAgentConfigSchema>; - src/index.ts:54-73 (registration)Tool registration in the ListToolsRequestSchema handler. Defines the tool name 'rezdy_agent_configure', description, and JSON input schema with apiKey (required) and environment (production/staging) properties.
{ name: 'rezdy_agent_configure', description: 'Configure Rezdy Agent API connection with API key and environment', inputSchema: { type: 'object', properties: { apiKey: { type: 'string', description: 'Rezdy Agent API key', }, environment: { type: 'string', enum: ['production', 'staging'], description: 'API environment (production or staging)', default: 'production', }, }, required: ['apiKey'], }, },