@x0333/bitrix24-mcp-server 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -41,13 +41,14 @@ if (!B24_PORTAL_URL) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const taskViewUrlPrefix = `${B24_PORTAL_URL}/company/personal/user/0/tasks/task/view/`;
|
|
44
|
-
const
|
|
45
|
-
`
|
|
44
|
+
const taskPortalLinkHowto =
|
|
45
|
+
`When the user needs a link to a task (or to paste one), use ${taskViewUrlPrefix}<task-id>/ — substitute only <task-id> with the numeric task ID from the API. Example: ${taskViewUrlPrefix}9483/`;
|
|
46
|
+
const mcpInstructions = `Bitrix24 address: ${B24_PORTAL_URL}. ${taskPortalLinkHowto}`;
|
|
46
47
|
|
|
47
48
|
const server = new Server(
|
|
48
49
|
{
|
|
49
50
|
name: "bitrix24-mcp-server",
|
|
50
|
-
version: "2.3.
|
|
51
|
+
version: "2.3.3",
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
capabilities: {
|
|
@@ -145,7 +146,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
145
146
|
},
|
|
146
147
|
{
|
|
147
148
|
name: "get_task",
|
|
148
|
-
description:
|
|
149
|
+
description:
|
|
150
|
+
"Retrieve task details by ID from Bitrix24. " +
|
|
151
|
+
taskPortalLinkHowto +
|
|
152
|
+
" The tool response JSON includes agent_instructions with the same rule plus a direct link for the requested task id.",
|
|
149
153
|
inputSchema: {
|
|
150
154
|
type: "object",
|
|
151
155
|
properties: {
|
|
@@ -260,9 +264,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
260
264
|
}
|
|
261
265
|
|
|
262
266
|
case "get_task": {
|
|
267
|
+
const taskId = Number(args.id);
|
|
263
268
|
const body = { taskId: args.id, select: args.select || ["*"] };
|
|
264
269
|
const data = await callBitrix("tasks.task.get", body);
|
|
265
|
-
|
|
270
|
+
throwIfBitrixError(data, "tasks.task.get");
|
|
271
|
+
const payload = {
|
|
272
|
+
...data,
|
|
273
|
+
agent_instructions: `${taskPortalLinkHowto} For this task: ${taskViewUrlPrefix}${taskId}/`,
|
|
274
|
+
};
|
|
275
|
+
return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
|
|
266
276
|
}
|
|
267
277
|
|
|
268
278
|
case "search_tasks": {
|