feat: add append_file tool to prevent errors caused by too long content#1233
Closed
gloridea wants to merge 1 commit intomodelcontextprotocol:mainfrom
Closed
feat: add append_file tool to prevent errors caused by too long content#1233gloridea wants to merge 1 commit intomodelcontextprotocol:mainfrom
gloridea wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
12 tasks
Member
|
Closing this PR — it has merge conflicts due to the major architecture refactoring (Nov 2025) and would need a full rewrite to use the current The Thank you for the contribution and the good motivation writeup — the use case of incremental writes for large content is exactly why we want this feature. This comment was posted by Claude Code on behalf of @olaservo. |
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.
Sometimes LLM generates long file contents that need to be generated in multiple consecutive responses.
However, the write_file tool supports write-at-once only. So the write_file call with long response not applied to file content, because it is not properly closed, and it makes repeating file write failure.
So I made the following changes:
Description
Server Details
Motivation and Context
I asked Calude Desktop to write a markdown file that contains a wide business research (total output was almost 24kB). While Claude Desktop trying to write the file, it failed repeatedly because Clauded encountered the output limit, so the write_file request is not closed successfuly.
How Has This Been Tested?
After I add this append_file, I ran filesystem mcp server locally again, restarted Claude Desktop, and asked to do the same operation, and Claude did it well by using new tools.
Breaking Changes
Not at all.
Types of changes
Checklist
Additional context