volkern_check_disponibilidad
Check available time slots for a specific date to schedule appointments. Use this tool before booking to verify availability based on duration requirements.
Instructions
Check available time slots for a specific date. Always call this before booking.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fecha | Yes | Date in YYYY-MM-DD format | |
| duracion | No | Duration in minutes (default: 60) |
Implementation Reference
- src/index.ts:779-784 (handler)Handler for volkern_check_disponibilidad tool - constructs query parameters (fecha and optional duracion) and calls the Volkern API endpoint /citas/disponibilidad
case "volkern_check_disponibilidad": { const params = new URLSearchParams(); params.append("fecha", String(args.fecha)); if (args.duracion) params.append("duracion", String(args.duracion)); return volkernRequest(`/citas/disponibilidad?${params.toString()}`); } - src/index.ts:150-161 (schema)Tool schema definition for volkern_check_disponibilidad - defines input parameters: fecha (required date string in YYYY-MM-DD format) and duracion (optional duration in minutes)
{ name: "volkern_check_disponibilidad", description: "Check available time slots for a specific date. Always call this before booking.", inputSchema: { type: "object", properties: { fecha: { type: "string", description: "Date in YYYY-MM-DD format" }, duracion: { type: "number", description: "Duration in minutes (default: 60)" } }, required: ["fecha"] } }, - src/index.ts:26-55 (helper)Helper function that makes HTTP requests to the Volkern API - handles authentication with Bearer token, JSON serialization, and error handling
async function volkernRequest( endpoint: string, method: string = "GET", body?: Record<string, unknown> ): Promise<unknown> { const url = `${VOLKERN_API_URL}${endpoint}`; const options: RequestInit = { method, headers: { "Authorization": `Bearer ${VOLKERN_API_KEY}`, "Content-Type": "application/json", }, }; if (body && method !== "GET") { options.body = JSON.stringify(body); } const response = await fetch(url, options); if (!response.ok) { const errorData = await response.json().catch(() => ({})); throw new Error( `Volkern API Error (${response.status}): ${JSON.stringify(errorData)}` ); } return response.json(); } - src/index.ts:961-986 (registration)MCP server request handler registration for CallToolRequestSchema - dispatches tool calls to handleToolCall function and formats responses
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await handleToolCall(name, args as Record<string, unknown>); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Error: ${errorMessage}`, }, ], isError: true, }; } });