b24_crm_delete
Remove a CRM entry in Bitrix24 using the record's unique identifier.
Instructions
Elimina un registro CRM por ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | No | ||
| entity_type_id | No | ||
| id | Yes | ||
| webhook_url | No |
Implementation Reference
- src/tools/crm.js:114-119 (handler)The actual handler function that executes the delete logic. It calls the Bitrix24 REST API using `${base}.delete` to remove a CRM record by ID, and returns success confirmation.
export async function crmDelete({ entity, entity_type_id, id, webhook_url }) { const client = new Bitrix24Client(resolveWebhook(webhook_url)); const { base, extra } = resolveMethod(entity, entity_type_id); await client.call(`${base}.delete`, { id, ...extra }); return { entity: entity || `SPA_${entity_type_id}`, portal: client.portal, deleted_id: id, success: true }; } - src/tools/crm.js:107-112 (schema)Zod schema defining input validation for b24_crm_delete: entity (optional), entity_type_id (optional integer), id (required string or number), webhook_url (optional URL).
export const crmDeleteSchema = z.object({ entity: z.string().optional(), entity_type_id: z.number().int().optional(), id: z.union([z.string(), z.number()]), webhook_url: z.string().url().optional(), }); - index.js:125-127 (registration)Registration of the 'b24_crm_delete' tool on the MCP server with description, schema, and wrapped handler.
server.tool('b24_crm_delete', 'Elimina un registro CRM por ID.', crmDeleteSchema.shape, wrap(crmDelete)); - index.js:13-16 (registration)Import of crmDeleteSchema and crmDelete from src/tools/crm.js into the main server registration file.
crmDeleteSchema, crmDelete, crmFieldsSchema, crmFields, timelineAddSchema, timelineAdd, } from './src/tools/crm.js';