create_opportunita
Create new sales opportunities in VTENext CRM by specifying name, status, estimated value, closing date, and description to track potential deals.
Instructions
Crea una nuova opportunità in VTENext
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nome | Yes | Nome dell'opportunità | |
| stato | No | Stato (es. Prospecting, Qualification, Closed Won) | Prospecting |
| importo | No | Valore stimato | |
| data_chiusura | No | Data chiusura prevista (YYYY-MM-DD) | |
| descrizione | No | Note o descrizione |
Implementation Reference
- index.js:87-99 (handler)Handler function for 'create_opportunita' tool which prepares the data object and calls the client.create method.
async ({ nome, stato, importo, data_chiusura, descrizione }) => { const element = { potentialname: nome, sales_stage: stato, amount: importo || 0, closingdate: data_chiusura || new Date().toISOString().split('T')[0], description: descrizione || '', }; const result = await client.create('Potentials', element); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - index.js:77-100 (registration)Registration of 'create_opportunita' tool including its schema definition.
server.tool( 'create_opportunita', 'Crea una nuova opportunità in VTENext', { nome: z.string().describe('Nome dell\'opportunità'), stato: z.string().optional().default('Prospecting').describe('Stato (es. Prospecting, Qualification, Closed Won)'), importo: z.number().optional().describe('Valore stimato'), data_chiusura: z.string().optional().describe('Data chiusura prevista (YYYY-MM-DD)'), descrizione: z.string().optional().describe('Note o descrizione'), }, async ({ nome, stato, importo, data_chiusura, descrizione }) => { const element = { potentialname: nome, sales_stage: stato, amount: importo || 0, closingdate: data_chiusura || new Date().toISOString().split('T')[0], description: descrizione || '', }; const result = await client.create('Potentials', element); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );