volkern_create_contrato_from_cotizacion
Generate a contract from an accepted quotation by specifying payment method, dates, and additional terms. This tool converts quotations into formal agreements within the CRM system.
Instructions
Create a contract from an accepted quotation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cotizacionId | Yes | The accepted quotation's ID | |
| fechaInicio | No | Contract start date | |
| fechaFin | No | Contract end date | |
| metodoPago | No | ||
| clausulas | No | Additional contract terms |
Implementation Reference
- src/index.ts:928-931 (handler)Handler for volkern_create_contrato_from_cotizacion tool. Extracts cotizacionId from args and makes a POST request to /contratos/from-cotizacion/{cotizacionId} with the remaining contract data.
case "volkern_create_contrato_from_cotizacion": { const { cotizacionId, ...contratoData } = args; return volkernRequest(`/contratos/from-cotizacion/${cotizacionId}`, "POST", contratoData); } - src/index.ts:722-736 (schema)Input schema definition for volkern_create_contrato_from_cotizacion tool. Defines properties: cotizacionId (required), fechaInicio, fechaFin, metodoPago (enum), and clausulas.
{ name: "volkern_create_contrato_from_cotizacion", description: "Create a contract from an accepted quotation", inputSchema: { type: "object", properties: { cotizacionId: { type: "string", description: "The accepted quotation's ID" }, fechaInicio: { type: "string", description: "Contract start date" }, fechaFin: { type: "string", description: "Contract end date" }, metodoPago: { type: "string", enum: ["unico", "mensual", "trimestral", "anual"] }, clausulas: { type: "string", description: "Additional contract terms" } }, required: ["cotizacionId"] } }, - src/index.ts:26-55 (helper)The volkernRequest helper function that handles all API calls to the Volkern API. Used by the handler to make HTTP requests with proper authentication headers.
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(); }