volkern_create_cotizacion
Generate a new quotation with line items, validity period, and notes for leads or deals in the CRM system.
Instructions
Create a new quotation/quote
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| leadId | No | Associated lead ID | |
| dealId | No | Associated deal ID | |
| validezDias | No | Validity period in days (default: 30) | |
| notas | No | Notes or terms | |
| items | Yes | Line items for the quote |
Implementation Reference
- src/index.ts:905-906 (handler)Handler for volkern_create_cotizacion: Makes a POST request to /cotizaciones endpoint with the provided arguments to create a new quotation
case "volkern_create_cotizacion": return volkernRequest("/cotizaciones", "POST", args); - src/index.ts:602-628 (schema)Schema definition for volkern_create_cotizacion tool: Defines input parameters including leadId, dealId, validezDias, notas, and an items array with concepto, cantidad, precioUnitario, and descuento fields
{ name: "volkern_create_cotizacion", description: "Create a new quotation/quote", inputSchema: { type: "object", properties: { leadId: { type: "string", description: "Associated lead ID" }, dealId: { type: "string", description: "Associated deal ID" }, validezDias: { type: "number", description: "Validity period in days (default: 30)" }, notas: { type: "string", description: "Notes or terms" }, items: { type: "array", items: { type: "object", properties: { concepto: { type: "string", description: "Item description" }, cantidad: { type: "number" }, precioUnitario: { type: "number" }, descuento: { type: "number", description: "Discount percentage" } }, required: ["concepto", "cantidad", "precioUnitario"] }, description: "Line items for the quote" } }, required: ["items"] } - src/index.ts:26-55 (helper)volkernRequest helper function: Handles HTTP requests to the Volkern API with authentication, method specification, 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:754-757 (handler)handleToolCall function signature: The main dispatcher function that routes tool calls to their specific handlers via a switch statement
async function handleToolCall( name: string, args: Record<string, unknown> ): Promise<unknown> { - src/index.ts:961-986 (registration)Server request handler registration: Sets up the CallToolRequestSchema handler that invokes handleToolCall for all tool execution requests
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, }; } });