Skip to content

Conversation

@AnuradhaKaruppiah
Copy link
Contributor

@AnuradhaKaruppiah AnuradhaKaruppiah commented Jan 23, 2026

Description

Tools were not being displayed in the UI for mcp_client function groups. This PR fixes the issue by updating the separator from period to dunder.

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed parsing of fully-qualified and aliased function names so tool discovery and initialization are more consistent across contexts, reducing missing or misnamed tools at startup.
  • Tests

    • Updated tests to reflect the improved naming/lookup behavior for group-qualified functions.

✏️ Tip: You can customize this high-level summary in your review settings.

@AnuradhaKaruppiah AnuradhaKaruppiah self-assigned this Jan 23, 2026
@AnuradhaKaruppiah AnuradhaKaruppiah added the bug Something isn't working label Jan 23, 2026
@AnuradhaKaruppiah AnuradhaKaruppiah requested a review from a team as a code owner January 23, 2026 17:02
@AnuradhaKaruppiah AnuradhaKaruppiah added the non-breaking Non-breaking change label Jan 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

Switches short-name extraction to use FunctionGroup.SEPARATOR/LEGACY_SEPARATOR, changes configured_short_names from set[str] to list[str], and applies the separator-aware logic consistently when building tool mappings in the FastAPI plugin worker and corresponding test(s).

Changes

Cohort / File(s) Summary
FastAPI front-end worker
src/nat/front_ends/fastapi/fastapi_front_end_plugin_worker.py
Add FunctionGroup import; change configured_short_names: set[str]list[str]; derive short names by splitting on FunctionGroup.SEPARATOR or FunctionGroup.LEGACY_SEPARATOR (with fallback to full name) in pass_through_filter, tool construction, mapping, and total_tools calculation.
Tests updated for separator
tests/nat/front_ends/fastapi/test_mcp_client_endpoint.py
Update test key construction to use FunctionGroup.SEPARATOR when forming alias-qualified function name used in group function map lookup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix MCP tool UI display' is concise, directly related to the main change (fixing MCP tool visibility in the UI), uses imperative mood, and is well within the 72-character limit.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Copy link
Member

@willkill07 willkill07 left a comment

Choose a reason for hiding this comment

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

Approving with minor feedback

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/nat/front_ends/fastapi/test_mcp_client_endpoint.py (1)

146-150: Inconsistent separator usage with the first test.

This test still uses the legacy separator (.) in the function keys at lines 148-149, while test_mcp_client_tool_list_success_with_alias was updated to use FunctionGroup.SEPARATOR (__). For consistency with the PR's goal of switching to the new separator, consider updating these keys as well.

Suggested fix
     group_name = "mcp_math"
     group_instance = _GroupInstanceStub(client,
                                         {
-                                            f"{group_name}.calculator__add": _FnStub("Add"),
-                                            f"{group_name}.calculator__subtract": _FnStub("Subtract"),
+                                            f"{group_name}{FunctionGroup.SEPARATOR}calculator__add": _FnStub("Add"),
+                                            f"{group_name}{FunctionGroup.SEPARATOR}calculator__subtract": _FnStub("Subtract"),
                                         })

Alternatively, if testing legacy separator support is intentional, consider renaming the test or adding a comment to clarify this intent.

@AnuradhaKaruppiah
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 195d19b into NVIDIA:release/1.4 Jan 23, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants