update_opportunita
Modify existing opportunity data in VTENext CRM by updating status, amount, or description fields for improved sales tracking.
Instructions
Aggiorna i dati di un'opportunità esistente
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID dell'opportunità (es. 13x42) | |
| stato | No | Nuovo stato | |
| importo | No | Nuovo importo | |
| descrizione | No | Note aggiornate |
Implementation Reference
- index.js:102-122 (handler)Implementation of the 'update_opportunita' tool which retrieves the current opportunity, updates the fields, and commits the changes back to the client.
server.tool( 'update_opportunita', 'Aggiorna i dati di un\'opportunità esistente', { id: z.string().describe('ID dell\'opportunità (es. 13x42)'), stato: z.string().optional().describe('Nuovo stato'), importo: z.number().optional().describe('Nuovo importo'), descrizione: z.string().optional().describe('Note aggiornate'), }, async ({ id, stato, importo, descrizione }) => { const current = await client.retrieve(id); const element = { ...current }; if (stato) element.sales_stage = stato; if (importo !== undefined) element.amount = importo; if (descrizione) element.description = descrizione; const result = await client.update(element); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );