fix: MCP writeNoSqlDatabaseContent 缺少嵌套对象部分更新的清晰文档与示例,易导致整块替换而非局部更新#691
Open
fix: MCP writeNoSqlDatabaseContent 缺少嵌套对象部分更新的清晰文档与示例,易导致整块替换而非局部更新#691
Conversation
…致整块替换而非局部更新 (issue_mojxi9ss_hae7qn)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Member
Author
Attribution post-PR evaluation
Cases
|
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.
Attribution issue
Automation summary
writeNoSqlDatabaseContentMCP tool's description andupdateparameter description mentioned using dot notation for nested field updates, but the warning was generic and lacked concrete JSON examples showing the exact WRONG vs CORRECT$setpayload format. When an agent saw a prompt like "update shipping to {city: guangzhou}", it naturally translated this into$set: { "shipping": { "city": "guangzhou" } }(replacing the entire object) instead of$set: { "shipping.city": "guangzhou" }(partial update). The abstractaddress.cityexample didn't clearly show the JSON structure difference.mcp/src/tools/databaseNoSQL.ts, enhanced the tool description with a prominent⚠️warning showing both the WRONG$set: {"shipping": {"city": "guangzhou"}}and CORRECT$set: {"shipping.city": "guangzhou"}JSON payloads. (2) In theupdateparameter description, added a❌/✅block with the same concrete WRONG vs CORRECT JSON examples, plus a backtick-wrappedshipping.citycode reference. (3) Updatedmcp/src/tools/databaseNoSQL.test.tsto assert the newshipping.cityreference instead of the oldaddress.city.Changed files
mcp/src/tools/databaseNoSQL.test.tsmcp/src/tools/databaseNoSQL.ts