-
Notifications
You must be signed in to change notification settings - Fork 288
Refactor response for Read and Update MCP tools to use built in utility functions #2984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the ReadRecordsTool and UpdateRecordTool to use centralized utility functions from McpResponseBuilder, improving code consistency and maintainability across all MCP tools.
- Replaces local
BuildErrorResult,BuildSuccessResult, andExtractResultJsonmethods with calls toMcpResponseBuilderutilities - Enhances response format to include
entityandmessagefields, aligning with other MCP tools - Moves result filtering logic inline in
UpdateRecordToolbefore passing to the utility function
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Azure.DataApiBuilder.Mcp/BuiltInTools/ReadRecordsTool.cs | Refactored to use McpResponseBuilder utilities; removed duplicate helper methods; improved exception handling to capture exception details |
| src/Azure.DataApiBuilder.Mcp/BuiltInTools/UpdateRecordTool.cs | Refactored to use McpResponseBuilder utilities; moved result filtering logic inline; removed duplicate helper methods while preserving GetJsonValue utility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to ensure we log the kind of tool it is in BuildErrorResult
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there are no automated tests yet, have you tested the refactoring did not introduce any regressions using Mcp Inspector?
Still need to test with the inspector, will add the test results to the PR description when done. |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Why make this change?
Closes #2919
What is this change?
Refactors the
ReadandUpdatebuilt in MCP tools so that they use the commonBuildErrorResultandBuildSuccessResultfunctiosn in the Utils, aligning their usage with the other tools.How was this tested?
Run against normal test suite.
Sample Request(s)
N/A