Repository navigation
Add periodictable MCP tool - #1414
tamohannes wants to merge 9 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new MCP stdio server wrapping the periodictable library providing Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant MCPServer as "Periodictable\n(stdio server)"
participant Lib as "periodictable\nlibrary"
Client->>MCPServer: start stdio server (python -m nemo_skills.mcp.servers.periodictable_tool)
Client->>MCPServer: list_tools() / call `element-info` or `isotope-info`
MCPServer->>Lib: lookup element / isotope data
Lib-->>MCPServer: element/isotope properties (or not found)
MCPServer-->>Client: formatted result or not-found message
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
gwarmstrong
left a comment
There was a problem hiding this comment.
Hi @tamohannes , Thank you for the contributions! I would encourage you to please switch to a tool path that avoids the MCP protocol (we have found it to cause real latency and stability issues during RL) in favor of a direct tool approach. The changes should be fairly minimal--please see the DirectPythonTool for an example.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/tests.yml:
- Around line 26-27: The step "Login to GHCR" is gated with an invalid
step-level conditional using secrets (if: ${{ secrets.GHCR_PAT != '' }});
instead populate an environment variable from the secret (e.g., set GHCR_PAT:
${{ secrets.GHCR_PAT }} at the job or workflow env level) and change the step
conditional to use the env context (if: env.GHCR_PAT != '') so the step can be
properly gated; update the "Login to GHCR" step to reference env.GHCR_PAT rather
than secrets.GHCR_PAT.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 5263bcab-ebbd-4579-af37-fdd2018d5c47
📒 Files selected for processing (1)
.github/workflows/tests.yml
Signed-off-by: tamohannes <[email protected]>
94bfacb to
77a2cb3
Compare
Signed-off-by: tamohannes <[email protected]>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/tests.yml (1)
26-33:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse
envfor GHCR gating; step-levelifshould not referencesecretsdirectly.This can break workflow validation and block CI execution. Switch the gate to
env.GHCR_PAT.Suggested patch
- name: Login to GHCR - if: ${{ secrets.GHCR_PAT != '' }} + env: + GHCR_PAT: ${{ secrets.GHCR_PAT }} + if: ${{ env.GHCR_PAT != '' }} uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GHCR_PAT }} + password: ${{ env.GHCR_PAT }}#!/bin/bash set -euo pipefail # 1) Quick pattern check for disallowed direct `secrets` usage in step-level `if` rg -nP '^\s*if:\s*\$\{\{\s*secrets\.' .github/workflows/tests.yml || true # 2) Full workflow lint check if actionlint is available if command -v actionlint >/dev/null 2>&1; then actionlint .github/workflows/tests.yml else echo "actionlint not installed; install it to validate context availability rules." fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/tests.yml around lines 26 - 33, The step "Login to GHCR" currently uses a step-level conditional referencing secrets (if: ${{ secrets.GHCR_PAT != '' }}), which is invalid; instead expose GHCR_PAT as an environment variable (e.g., set env.GHCR_PAT: ${{ secrets.GHCR_PAT }} at the job or workflow level) and change the step conditional to reference env.GHCR_PAT (if: ${{ env.GHCR_PAT != '' }}); update the "Login to GHCR" step that uses docker/login-action@v3 to use the new env variable for gating and keep the password value as ${{ secrets.GHCR_PAT }} in the step inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/tests.yml:
- Around line 26-33: The step "Login to GHCR" currently uses a step-level
conditional referencing secrets (if: ${{ secrets.GHCR_PAT != '' }}), which is
invalid; instead expose GHCR_PAT as an environment variable (e.g., set
env.GHCR_PAT: ${{ secrets.GHCR_PAT }} at the job or workflow level) and change
the step conditional to reference env.GHCR_PAT (if: ${{ env.GHCR_PAT != '' }});
update the "Login to GHCR" step that uses docker/login-action@v3 to use the new
env variable for gating and keep the password value as ${{ secrets.GHCR_PAT }}
in the step inputs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8f4b2aed-063d-48e5-be96-46f7191c8e7a
📒 Files selected for processing (4)
.github/workflows/tests.ymldocs/agentic_inference/tool_calling.mdnemo_skills/mcp/servers/periodictable_tool.pytests/test_mcp_clients.py
✅ Files skipped from review due to trivial changes (2)
- docs/agentic_inference/tool_calling.md
- nemo_skills/mcp/servers/periodictable_tool.py
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/test_mcp_clients.py
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
Updated this PR to use the direct \ path instead of launching a stdio MCP server. The PR diff is now limited to the tool implementation, docs reference, and focused tests; workflow/pyproject changes were removed. @coderabbitai review |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
|
Updated this PR to use the direct Tool path instead of launching a stdio MCP server. The PR diff is now limited to the tool implementation, docs reference, and focused tests; workflow/pyproject changes were removed. @coderabbitai review |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
Signed-off-by: tamohannes <[email protected]>
|
Updated to the direct Tool implementation path (no stdio MCP server/client). The final diff is scoped to the tool file, docs reference, and focused tests only. @coderabbitai review |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
…-mcp-tool Signed-off-by: tamohannes <[email protected]>
|
Closing in favor of #1421, reopened from an internal NVIDIA-NeMo/Skills branch so CI can access repository secrets. |
Summary
Test plan
Made with Cursor
Summary by CodeRabbit
New Features
Documentation
Tests
Chores