Repository navigation
[REMOTE] Write tools return the full work item: ~1 MB/week of unused payload in agent sessions (follow-up to #562) #1681
Steve Beaugé (stevebeauge)
started this conversation in
Backlog of Suggestions
Replies: 1 comment
|
We are not getting any other folks reporting this as an issue. It is returning results as expected. I am happy to keep an eye on the issue and if we get others reporting the concern, we can re-consider. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Issue Type
Tool(s)
wit_work_item_write(update,add_child)wit_work_item_link_write(link)wit_work_item_comment_write(add)repo_pull_request_thread(list)Description
Follow-up to #562, which was closed for lack of concrete examples. Write tools return the full work item (or the full comment) when the caller only needs a confirmation. Below are measurements and three real examples from one week of use.
I checked the documented configuration first: the
X-MCP-Toolsets,X-MCP-Tools,X-MCP-ReadonlyandX-MCP-Insidersheaders and the tool schemas offer no way to reduce response size.Context
https://mcp.dev.azure.com), used from Claude Code.Measured response sizes
wit_work_item_writewit_work_item_link_writewit_work_item_comment_writerepo_pull_request_thread(list)Write calls alone returned ~1.1 MB over the week, i.e. roughly 300k tokens that went straight into the agent's context window.
Example 1:
wit_work_item_link_write,action: "link", one link added, 30 KB returnedInput: one link between two existing work items, a couple of hundred bytes.
Response: the full work item.
fields(35 fields)System.Description= 15.3 KBrelations(19 entries, the item's whole relation list)linksid,rev,url: what the caller actually needsfieldsholds five identity objects (AssignedTo,CreatedBy,ChangedBy,ActivatedBy,ClosedBy) of 923 bytes each, with the same 13 keys every time (values redacted):{ "descriptor": "aad.…", "displayName": "…", "url": "https://…", "links": { "avatar": { "href": "…" } }, "id": "…", "uniqueName": "…@…", "imageUrl": "…", "isContainer": false, "isAadIdentity": true, "inactive": false, "isDeletedInOrigin": false, "displayNameForXmlSerialization": "…", "urlForXmlSerialization": "…" }A 15 KB description has nothing to do with adding a link.
Example 2:
wit_work_item_write,action: "add_child", 10 children created, 50 KB returnedThe response is an array of the 10 new items, ~4.8 KB each: full
fields(16 fields, including theDescriptionthe caller just sent, andCreatedBy/ChangedByidentities at 923 bytes each), plusrelationsandlinks. What the agent needs next is the 10ids, about 60 bytes.Example 3:
wit_work_item_comment_write,action: "add", a 4.9 KB comment returned as 17.5 KBThe response echoes the comment twice:
text(4.9 KB, the Markdown the caller just sent) andrenderedText(6.2 KB of HTML), pluscreatedByandmodifiedByidentities (923 bytes each). What the agent needs next is the commentid.Why it matters
After a write, the agent only needs to know that it succeeded, plus
id,revandurlto chain the next call (therevfor aTest /revoperation, for instance). The rest of the payload is never read, but it crowds out useful context: compaction happens sooner and long sessions cost more. A session that updates 10–20 work items pays 100–300 KB for confirmations.Suggestion
id,rev,url, plus the commentidfor comment writes.fullOutput: true, as suggested in Unnecessarily verbose wit tool output #562) restores the current behaviour.displayName+uniqueName(orid) unless the full output is requested.repo_pull_request_threadlist: an option to skip system/deleted comments, or to return thread status + first comment only.All reactions