Conversation
…eachable Closes bitrix24#203. `select: ['id', 'title', 'description']` reached Bitrix24 intact and Bitrix24 returned the body — then `toTaskShort` rebuilt each row from a hard-coded field list and dropped it. The select looked honoured while the task body was unreachable through the MCP entirely, since there is no single-task get tool either: an agent asked "what is this task about?" had nothing but the title to go on. Two changes: - `description` is projected when the caller puts it in the `select`, in full and never truncated, alongside Bitrix24's `descriptionInBbcode` flag ("Y"/"N" coerced to a boolean — true means the body is BBCode, false HTML) so the agent knows how to read the markup. - The select-only scalars `groupId`, `createdBy`, `parentId`, `changedDate` and `closedDate` are projected whenever Bitrix24 ships them. Bitrix24 omits these unless they are selected, so "present on the wire" already means "the operator asked for it" — no flag needed. `parentId` also unblocks walking subtasks (`MANUAL-TEST-PHRASES.md` §10.2). Default listings are byte-identical to before — the default select asks for none of these fields. The body stays behind an explicit opt-in (`ToTaskShortOptions. withDescription`) rather than riding along with the scalars, because `toTaskShort` is shared with create / update / rate and the seven lifecycle verbs, and Bitrix24 echoes the full task on those endpoints. An always-on `description` would bill the agent for a body it had just written, on every mutation. The nested `group` / `creator` objects Bitrix24 adds unbidden next to `groupId` / `createdBy` stay dropped — they carry member counts, avatar URLs and work positions, which is a lot of tokens nobody asked for. Verified against a live portal: with `description` in the select the body comes back (764 chars, `descriptionInBbcode: true`); without it the response is unchanged. +9 unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #203 —
b24_task_listaccepted aselect, passed it to Bitrix24 correctly, and then threw away everything outside the default seven fields, so a task's body could not be read through this MCP at all.descriptionnow comes back when it's in theselect(with Bitrix24'sdescriptionInBbcodemarkup flag), and so do the select-only scalarsgroupId/createdBy/parentId/changedDate/closedDate.Type of change
Linked issue
Closes #203
Checklist
pnpm lintpassespnpm typecheckpassespnpm testpassesdocs/andskills/(README tool table + theb24_task_listtool description; the tool-authoring conventions are unchanged, sodocs/ADDING-TOOLS.mdand the agent skill need no edit)Screenshots / logs
Live portal, same task, before and after. With the field selected:
{"total":1,"returned":1,"tasks":[{"id":"4153","title":"…","description":"[b]Причина[/b]\n\n…","descriptionInBbcode":true,"groupId":"111","createdBy":"35"}]}Default listing, unchanged (no new keys, no extra bytes):
{"total":null,"returned":1,"tasks":[{"id":"4153","title":"…","status":"2","deadline":null,"responsibleId":"9","createdDate":"…","priority":"1"}]}The body in that first response is 764 characters; nothing is truncated.
Notes for reviewers
The bug was entirely in the projection, not the transport.
normalizeBitrix24Selectdid its job andtasks.task.listreturned the field —toTaskShortthen rebuilt each row from a fixed field list, so theselectlooked honoured while the data quietly vanished. Worth knowing because the same shape applies to any field a future PR wants to surface.Two decisions I'd particularly like a second opinion on:
Why the body is opt-in but the scalars aren't. Bitrix24 omits
groupId/createdBy/parentId/changedDate/closedDateunless they're selected, so "present on the wire" is already equivalent to "the operator asked for it" — projecting them when present is honouring the select, no flag needed.descriptionis different:toTaskShortis shared with create / update / rate and the seven lifecycle verbs, and Bitrix24 echoes the full task on those endpoints. Projecting the body unconditionally would bill the agent for a description it had just written, on every mutation. HenceToTaskShortOptions.withDescription, which only the read path sets.What I left dropped on purpose. Bitrix24 ships nested
groupandcreatorobjects alongsidegroupId/createdBywithout being asked — member counts, work positions, avatar URLs. Those stay out of the projection; if someone wants the group name,groupIdplus a group tool is the cheaper path. There's a test pinning this so it doesn't drift back in.Issue #203 also mentions the absence of a single-task get tool. I didn't add one here — with
filter: { id: N }plus aselectthe list tool now covers the "what is this task about" case, and ab24_task_geton v3 is a separate decision (it's the worked example inskills/manage-bx24-template-mcp/adding-tools.mdbut has never shipped). Happy to do it as a follow-up if you'd rather have the dedicated tool.Unrelated to this PR but same reporter, in case it's useful triage: #203 also lists
createdByandgroupId, which this covers, and the reporter's other open issue (#205) is a separate matter.