[AI-206] Add get_loan_details MCP tool with validation and structured errors#298
Open
Kartikey-Malkani wants to merge 2 commits intoopenMF:mainfrom
Open
[AI-206] Add get_loan_details MCP tool with validation and structured errors#298Kartikey-Malkani wants to merge 2 commits intoopenMF:mainfrom
Kartikey-Malkani wants to merge 2 commits intoopenMF:mainfrom
Conversation
Contributor
|
Lgtm for me - What do you think @IOhacker |
IOhacker
requested changes
Mar 30, 2026
Contributor
IOhacker
left a comment
There was a problem hiding this comment.
Add this Jira ticket in the PR title https://mifosforge.jira.com/browse/AI-206
…e cases - Add comprehensive docstring with args, returns, and edge cases - Include example success and error responses in JSON format - Document all common loan status values and response fields - Clarify API requirements and error conditions Closes AI-206
Author
|
Thanks for the feedback! I’ve incorporated the Jira ticket in both the PR title and description, and made the requested updates. Also ensured consistency across validation, logging, and documentation changes. Please let me know if any further refinements are needed. |
Author
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.


Jira: https://mifosforge.jira.com/browse/AI-206
Summary - Add domain-level get_loan_details(loan_id) function with input validation - Add centralized MCP-level endpoint in mcp_server.py - Include comprehensive error handling for invalid IDs and failed API calls - Add unit tests covering success, invalid input, and API failure cases ## Changes - python/tools/domains/loans.py: new get_loan_details() with validation - python/mcp_server.py: MCP tool registration + backward-compatible alias - python/tests/test_loans.py: tests for valid/invalid/error cases ## Verification - Tests pass: 12 passed Closes AI-206