create_agency
Create a new travel agency in LumbreTravel by providing name, description, and provider details after checking for existing agencies.
Instructions
Crear una agencia. Antes de crear una nueva agencia se debe preguntar al si quiere que primero se busque la agencia a ver si existe
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Nombre de la agencia | |
| description | Yes | Descripción de la agencia | |
| provider | Yes |
Implementation Reference
- src/handlers/tools.handler.ts:1431-1437 (handler)The handler function for the 'create_agency' MCP tool. It destructures the input arguments, calls the ApiService.createAgency method, and formats the response as MCP content.case 'create_agency': { const { name, description, provider } = args const agency = await this.apiService.createAgency({ name, description, provider }) return { content: [{ type: 'text', text: JSON.stringify(agency, null, 2) }] } }
- The schema definition and registration of the 'create_agency' tool within the listTools() method, including name, description, and inputSchema.{ name: 'create_agency', description: 'Crear una agencia. Antes de crear una nueva agencia se debe preguntar al si quiere que primero se busque la agencia a ver si existe', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre de la agencia' }, description: { type: 'string', description: 'Descripción de la agencia' }, provider: { type: 'object', properties: { id: { type: 'string', description: 'ID del proveedor de la agencia.' }, name: { type: 'string', description: 'Nombre del proveedor de la agencia' } } } }, required: ['name', 'description', 'provider'] } },
- src/services/api.service.ts:428-443 (helper)Supporting service method that makes the actual HTTP POST request to the backend API endpoint to create an agency using the provided data.async createAgency (data: { name: string description: string provider: { id: string name: string } }) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/agency/create`, { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) return await this.handleResponse<any>(response) }