b24_feed_post
Post a message to the Bitrix24 activity feed using BB-code formatting. Optionally set a title, target specific users or groups, attach files, or mark as important.
Instructions
Publica un mensaje en el feed de actividad (Live Feed) de Bitrix24, con soporte BB-code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Texto del mensaje. Soporta BB-code: [B]negrita[/B], [I]italica[/I], [URL=http://...]texto[/URL] | |
| title | No | Título del post (opcional) | |
| destination | No | IDs de usuarios o grupos destino. Si está vacío, se publica para todos. Formato: ["U5", "U10"] para usuarios, ["SG12"] para grupos | |
| files | No | Adjuntos en formato Base64 | |
| important | No | Si true, marca el post como importante | |
| webhook_url | No |
Implementation Reference
- src/tools/feed-notifications.js:20-30 (handler)The actual handler function for the 'b24_feed_post' tool. Calls Bitrix24 API method 'log.blogpost.add' with message, title, destination, files, and important flag.
export async function feedPost({ message, title, destination, files, important = false, webhook_url }) { const client = new Bitrix24Client(resolveWebhook(webhook_url)); const res = await client.call('log.blogpost.add', { POST_MESSAGE: message, ...(title ? { POST_TITLE: title } : {}), ...(destination ? { DESTINATION: destination } : {}), ...(files ? { FILES: files } : {}), IMPORTANT: important ? 'Y' : 'N', }); return { portal: client.portal, post_id: res.result, success: true }; } - src/tools/feed-notifications.js:8-18 (schema)Zod schema defining the input parameters for b24_feed_post: message (required), title, destination (array of user/group IDs), files (Base64), important (boolean, default false), webhook_url (optional URL).
export const feedPostSchema = z.object({ message: z.string().describe('Texto del mensaje. Soporta BB-code: [B]negrita[/B], [I]italica[/I], [URL=http://...]texto[/URL]'), title: z.string().optional().describe('Título del post (opcional)'), destination: z.array(z.union([z.string(), z.number()])).optional().describe( 'IDs de usuarios o grupos destino. Si está vacío, se publica para todos. ' + 'Formato: ["U5", "U10"] para usuarios, ["SG12"] para grupos' ), files: z.array(z.string()).optional().describe('Adjuntos en formato Base64'), important: z.boolean().optional().default(false).describe('Si true, marca el post como importante'), webhook_url: z.string().url().optional(), }); - index.js:230-233 (registration)Registration of the 'b24_feed_post' tool on the MCP server with description and schema binding.
// ── Feed y Comunicación ─────────────────────────────────────────────────────── server.tool('b24_feed_post', 'Publica un mensaje en el feed de actividad (Live Feed) de Bitrix24, con soporte BB-code.', feedPostSchema.shape, wrap(feedPost)); - index.js:55-63 (helper)Import statement that brings feedPostSchema and feedPost into the main index.js file from the feed-notifications module.
import { feedPostSchema, feedPost, notifySendSchema, notifySend, groupsListSchema, groupsList, chatSendSchema, chatSend, bizprocListSchema, bizprocList, bizprocStartSchema, bizprocStart, telephonyCallsSchema, telephonyCalls, } from './src/tools/feed-notifications.js';