Skip to content

Add CoolProp MCP tool - #1420

Merged
tamohannes merged 12 commits into
mainfrom
feat/coolprop-mcp-tool
May 2, 2026
Merged

tamohannes merged 12 commits into
mainfrom
feat/coolprop-mcp-tool

Conversation

@tamohannes

@tamohannes tamohannes commented May 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Reopened from an internal NVIDIA-NeMo/Skills branch so CI can access repository secrets.
  • Replaces Add CoolProp MCP tool #1413.
  • Add a built-in CoolProp MCP tool for thermophysical fluid property lookup.
  • Document the new built-in tool and add focused MCP client tests.

Test plan

  • python -m py_compile nemo_skills/mcp/servers/coolprop_tool.py
  • python -m pytest tests/test_mcp_clients.py::TestCoolPropTool -q --tb=short
  • python -m pytest tests/test_mcp_clients.py -q --tb=short

Summary by CodeRabbit

  • New Features

    • Added a CoolProp-based tool for thermophysical fluid lookups: query fluid properties by temperature and pressure and list available fluids.
  • Documentation

    • Updated the Built-in Tools reference to include the new CoolProp tool and usage notes.
  • Tests

    • Added tests to verify tool configuration and that both property-lookup and fluid-list endpoints are exposed.

tamohannes added 9 commits May 1, 2026 12:02
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
…tool

Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
@coderabbitai

coderabbitai Bot commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7d2b9c41-dad9-426d-a697-12b5783d2b3f

📥 Commits

Reviewing files that changed from the base of the PR and between 6a7bf17 and 95696b0.

📒 Files selected for processing (1)
  • tests/test_mcp_clients.py
✅ Files skipped from review due to trivial changes (1)
  • tests/test_mcp_clients.py

📝 Walkthrough

Walkthrough

Adds a new MCP tool module nemo_skills.mcp.servers.coolprop_tool.CoolPropTool that exposes fluid-property and fluid-list endpoints using the CoolProp library, adds tests verifying config and listed tools, and documents the tool in the Built-in Tools reference (notes CoolProp dependency).

Changes

CoolPropTool Feature

Layer / File(s) Summary
Data / Utility functions
nemo_skills/mcp/servers/coolprop_tool.py
Adds fluid_property(fluid, output_property, temperature, pressure) with positive-temperature/pressure validation, CoolProp PropsSI call, error handling, property descriptions, and markdown formatting.
Helper / Listing
nemo_skills/mcp/servers/coolprop_tool.py
Adds fluid_list() that queries CoolProp.FluidsList(), sorts fluids, and returns a markdown list.
Core MCP wiring
nemo_skills/mcp/servers/coolprop_tool.py
Adds CoolPropTool class implementing default_config, configure, async list_tools (JSON-schema for fluid-property and fluid-list), and async execute dispatcher routing to the two functions and returning an error for unknown tools.
Tests / Integration
tests/test_mcp_clients.py
Adds TestCoolPropTool with test_coolprop_tool_config asserting default_config() == {} and test_coolprop_direct_list_tools (async) asserting list_tools() includes fluid-property and fluid-list after configure().
Documentation
docs/agentic_inference/tool_calling.md
Adds Built-in Tools reference entry for nemo_skills.mcp.servers.coolprop_tool.CoolPropTool, describing CoolProp-based thermophysical property lookup and noting the CoolProp dependency.
sequenceDiagram
    participant Client
    participant MCP_Server as "CoolPropTool (MCP)"
    participant CoolProp as "CoolProp Library"
    Client->>MCP_Server: execute("fluid-property", {fluid, output_property, temperature, pressure})
    MCP_Server->>CoolProp: PropsSI(output_property, "T", temperature, "P", pressure, fluid)
    CoolProp-->>MCP_Server: value or error
    MCP_Server-->>Client: markdown-formatted result or error
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add CoolProp MCP tool' clearly and concisely summarizes the main change: introducing a new CoolProp MCP tool for thermophysical fluid property lookup.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/coolprop-mcp-tool

Review rate limit: 8/10 reviews remaining, refill in 7 minutes and 55 seconds.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/test_mcp_clients.py (1)

1010-1025: ⚡ Quick win

Add a direct execute() smoke test for the new tool.

Right now the suite only checks config and tool names, so a broken dispatch path or CoolProp import would still pass. A single fluid-list call would cover the actual runtime entry point.

♻️ Proposed test addition
     tool = CoolPropTool()
     tool.configure()
     tool_names = {t["name"] for t in await tool.list_tools()}
     assert "fluid-property" in tool_names
     assert "fluid-list" in tool_names
+
+    result = await tool.execute("fluid-list", {})
+    assert "fluids available" in result
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_mcp_clients.py` around lines 1010 - 1025, Add a smoke test that
actually calls the tool runtime entrypoint: instantiate CoolPropTool(), call
configure(), find the tool descriptor for "fluid-list" from await
tool.list_tools(), then call await tool.execute(tool_descriptor, {}) (or the
execute signature used by CoolPropTool) and assert the call returns a successful
result (e.g., non-empty list or expected keys). Update the TestCoolPropTool
class (near test_coolprop_direct_list_tools) to include a new async test method
that locates the "fluid-list" tool and exercises CoolPropTool.execute to catch
import/dispatch/runtime errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/agentic_inference/tool_calling.md`:
- Around line 374-375: Remove the duplicated bullet for
nemo_skills.mcp.servers.coolprop_tool.CoolPropTool in the tool list: keep a
single entry for CoolPropTool (with the preferred description—e.g.,
"Thermophysical fluid property lookup via CoolProp (requires `CoolProp`)") and
delete the other identical line so the built-in-tools list contains only one
CoolPropTool entry.

---

Nitpick comments:
In `@tests/test_mcp_clients.py`:
- Around line 1010-1025: Add a smoke test that actually calls the tool runtime
entrypoint: instantiate CoolPropTool(), call configure(), find the tool
descriptor for "fluid-list" from await tool.list_tools(), then call await
tool.execute(tool_descriptor, {}) (or the execute signature used by
CoolPropTool) and assert the call returns a successful result (e.g., non-empty
list or expected keys). Update the TestCoolPropTool class (near
test_coolprop_direct_list_tools) to include a new async test method that locates
the "fluid-list" tool and exercises CoolPropTool.execute to catch
import/dispatch/runtime errors.
🪄 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: 53a37043-5f5d-44ee-bcdd-c82d1282e5dc

📥 Commits

Reviewing files that changed from the base of the PR and between 6877a00 and ac832ef.

📒 Files selected for processing (3)
  • docs/agentic_inference/tool_calling.md
  • nemo_skills/mcp/servers/coolprop_tool.py
  • tests/test_mcp_clients.py

Comment thread docs/agentic_inference/tool_calling.md Resolved
@gwarmstrong

Copy link
Copy Markdown
Collaborator

please fix the DCO check

Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
@tamohannes
tamohannes force-pushed the feat/coolprop-mcp-tool branch from 90ee1ea to ae7ecd5 Compare May 2, 2026 00:14
tamohannes added 2 commits May 1, 2026 19:08
Signed-off-by: Hovhannes Tamoyan <hovhannes.tamoyan@gmail.com>
Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
@tamohannes
tamohannes merged commit 2ffb426 into main May 2, 2026
5 checks passed
@tamohannes
tamohannes deleted the feat/coolprop-mcp-tool branch May 2, 2026 02:46
cmunley1 added a commit to NVIDIA-NeMo/Gym that referenced this pull request Jun 16, 2026
## Summary

- Add a NeMo-Gym `ns_tools` config that exposes `CoolPropTool` through
the existing NeMo-Skills ToolManager bridge.
- Add a focused config test to keep the resource-server wiring valid.
- This is the Gym-side companion to NVIDIA-NeMo/Skills#1420.

Replaces fork-origin PR #1218 so CI can run with full repository
secrets.

## Test plan

- `PYTHONPATH=. python -m pytest
resources_servers/ns_tools/tests/test_coolprop_mcp_config.py -q
--tb=short`

---------

Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Co-authored-by: Christian Munley <cmunley@nvidia.com>
ritaneves pushed a commit to NVIDIA-NeMo/Gym that referenced this pull request Jun 25, 2026
## Summary

- Add a NeMo-Gym `ns_tools` config that exposes `CoolPropTool` through
the existing NeMo-Skills ToolManager bridge.
- Add a focused config test to keep the resource-server wiring valid.
- This is the Gym-side companion to NVIDIA-NeMo/Skills#1420.

Replaces fork-origin PR #1218 so CI can run with full repository
secrets.

## Test plan

- `PYTHONPATH=. python -m pytest
resources_servers/ns_tools/tests/test_coolprop_mcp_config.py -q
--tb=short`

---------

Signed-off-by: tamohannes <hovhannes.tamoyan@gmail.com>
Co-authored-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Rita Fernandes Neves <rfernandesne@nvidia.com>
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.

2 participants