create_service
Add new travel services to the LumbreTravel platform by specifying service name, description, and provider details for program management.
Instructions
Crear un servicio
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Nombre del servicio | |
| description | Yes | Descripción del servicio | |
| provider | Yes |
Implementation Reference
- src/handlers/tools.handler.ts:1511-1517 (handler)Handler implementation for the 'create_service' tool. It destructures the input arguments (name, description, provider), calls ApiService.createService, and returns the created service as JSON text.case 'create_service': { const { name, description, provider } = args const service = await this.apiService.createService({ name, description, provider }) return { content: [{ type: 'text', text: JSON.stringify(service, null, 2) }] } }
- Input schema and metadata definition for the 'create_service' tool, returned by listTools().name: 'create_service', description: 'Crear un servicio', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre del servicio' }, description: { type: 'string', description: 'Descripción del servicio' }, provider: { type: 'object', properties: { id: { type: 'string', description: 'ID del proveedor' }, name: { type: 'string', description: 'Nombre del proveedor' } } } }, required: ['name', 'description', 'provider'] } },
- src/services/api.service.ts:670-684 (helper)ApiService.createService method that performs the HTTP POST request to the backend API endpoint to create a new service.async createService (data: { name: string description: string provider: { id: string name: string } }) { const headers = await this.getHeaders() const response = await fetch(`${API_CONFIG.baseUrl}/integrations/mcp/service/create`, { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) return await this.handleResponse<any>(response)
- src/index.ts:38-47 (registration)MCP server request handlers for listing tools (which includes 'create_service') and calling tools (dispatches to ToolsHandler based on name).this.server.setRequestHandler( ListToolsRequestSchema, async () => this.toolsHandler.listTools() ) // Configure handlers for tools this.server.setRequestHandler( CallToolRequestSchema, async (request) => await this.toolsHandler.callTool(request.params.name, request.params.arguments, this.server) )
- src/handlers/tools.handler.ts:2-11 (helper)Import of ApiService used by the tools handler.import { ApiService } from '../services/api.service.js' import { formatDate } from '../utils/date.utils.js' import { type Server } from '@modelcontextprotocol/sdk/server/index.js' export class ToolsHandler { private readonly apiService: ApiService constructor () { this.apiService = new ApiService() }