b24_tasks_create
Create a new task with title, description, assignee, deadline, priority, and other optional fields in Bitrix24.
Instructions
Crea una nueva tarea con título, descripción, responsable, fecha límite, prioridad y más.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | Campos de la tarea. Requeridos: TITLE. Opcionales: DESCRIPTION, RESPONSIBLE_ID, DEADLINE (ISO8601), GROUP_ID, PRIORITY (0=baja, 1=normal, 2=alta), PARENT_ID, TAGS, CHECKLIST | |
| webhook_url | No |
Implementation Reference
- src/tools/tasks.js:67-71 (handler)The handler function 'tasksCreate' that executes the tool logic. It creates a new Bitrix24 task by calling 'tasks.task.add' with the provided fields and returns the created task ID.
export async function tasksCreate({ fields, webhook_url }) { const client = new Bitrix24Client(resolveWebhook(webhook_url)); const res = await client.call('tasks.task.add', { fields }); return { portal: client.portal, created_id: res.result?.task?.id ?? res.result, success: true }; } - src/tools/tasks.js:58-65 (schema)The Zod schema 'tasksCreateSchema' defining input validation for the tool: 'fields' (object with TITLE required, plus optional fields) and 'webhook_url' (optional URL).
export const tasksCreateSchema = z.object({ fields: z.record(z.any()).describe( 'Campos de la tarea. Requeridos: TITLE. ' + 'Opcionales: DESCRIPTION, RESPONSIBLE_ID, DEADLINE (ISO8601), GROUP_ID, ' + 'PRIORITY (0=baja, 1=normal, 2=alta), PARENT_ID, TAGS, CHECKLIST' ), webhook_url: z.string().url().optional(), }); - index.js:183-185 (registration)Registration of the tool on the MCP server via server.tool('b24_tasks_create', ...), wiring the schema and handler.
server.tool('b24_tasks_create', 'Crea una nueva tarea con título, descripción, responsable, fecha límite, prioridad y más.', tasksCreateSchema.shape, wrap(tasksCreate)); - index.js:31-37 (registration)Import of tasksCreateSchema and tasksCreate from the tools/tasks.js module into index.js.
import { tasksListSchema, tasksList, tasksGetSchema, tasksGet, tasksCreateSchema, tasksCreate, tasksUpdateSchema, tasksUpdate, tasksCompleteSchema, tasksComplete, } from './src/tools/tasks.js';