fix: surface error details from failed bulk edit operations#6
Open
zagah wants to merge 1 commit intobarryw:mainfrom
Open
fix: surface error details from failed bulk edit operations#6zagah wants to merge 1 commit intobarryw:mainfrom
zagah wants to merge 1 commit intobarryw:mainfrom
Conversation
Changes BulkEditDocumentsAsync return type from Task<bool> to Task<(bool Success, string? Error)>. On failure the error now includes the HTTP status code and response body (or exception message), which is surfaced to the MCP caller rather than swallowed silently. Also uses StringContent with explicit runtime-type serialization to avoid the base-type serialization issue with PostAsJsonAsync<object>.
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
BulkEditDocumentsAsyncreturn type fromTask<bool>toTask<(bool Success, string? Error)>DocumentTools.csto include the error detail in the MCP responsePostAsJsonAsync<object>withStringContent+ explicit runtime-type serialization to avoid base-type serialization dropping propertiesMotivation
Currently a failed bulk edit silently returns
falsewith no explanation. The MCP caller gets "Bulk operation failed" with no context. This change propagates the actual HTTP error (e.g.HTTP 400: {"detail": "Invalid tag ID"}) back to the caller.Test plan
🤖 Generated with Claude Code