Skip to content

[AI-206] Add get_loan_details MCP tool with validation and structured errors#298

Open
Kartikey-Malkani wants to merge 2 commits intoopenMF:mainfrom
Kartikey-Malkani:feat/get-loan-details-mcp-tool
Open

[AI-206] Add get_loan_details MCP tool with validation and structured errors#298
Kartikey-Malkani wants to merge 2 commits intoopenMF:mainfrom
Kartikey-Malkani:feat/get-loan-details-mcp-tool

Conversation

@Kartikey-Malkani
Copy link
Copy Markdown

@Kartikey-Malkani Kartikey-Malkani commented Mar 29, 2026

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

@gyanLM10
Copy link
Copy Markdown
Contributor

Lgtm for me - What do you think @IOhacker

Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this Jira ticket in the PR title https://mifosforge.jira.com/browse/AI-206

@Kartikey-Malkani Kartikey-Malkani changed the title Add get_loan_details MCP tool with validation and structured errors [AI-206] Add get_loan_details MCP tool with validation and structured errors Mar 30, 2026
…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
@Kartikey-Malkani
Copy link
Copy Markdown
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.

@Kartikey-Malkani
Copy link
Copy Markdown
Author

MCP Tool Execution
Test

Added demo screenshot showing MCP tool execution for get_loan_details.

This demonstrates:

  • Successful tool invocation
  • Structured JSON response
  • Clean output for debugging and validation

Let me know if you'd like additional examples (error cases, edge cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants