Skip to content

feat: real ares-server integration (0.3.1 → 0.7.2)#16

Merged
bkataru merged 1 commit into
masterfrom
feat/real-ares-integration
Apr 10, 2026
Merged

feat: real ares-server integration (0.3.1 → 0.7.2)#16
bkataru merged 1 commit into
masterfrom
feat/real-ares-integration

Conversation

@bkataru

@bkataru bkataru commented Apr 10, 2026

Copy link
Copy Markdown
Member

Summary

Replaces the placeholder ares_integration.rs stub with a real wrapper around ares::ToolRegistry and bumps ares-server 0.3.1 → 0.7.2.

The previous stub hard-coded four fake tool definitions and had a TODO comment "This would connect to ares-server's ToolRegistry" — it never actually imported anything. The ares-server = "0.3.1" dep was declared but unused.

Key changes

  • Import path is ares:: (per [lib] name = "ares" in ares Cargo.toml), NOT ares_server:: (which is only the crates.io package name)
  • AresToolRegistry holds a real ares::ToolRegistry internally
  • with_default_tools() registers ares::tools::calculator::Calculator
  • Optional ares-search feature registers WebSearch (gated by ares-server/search-tools)
  • get_all_tools() returns real ares tool definitions, converted via ares_to_thulp_definition() which walks JSON Schema properties and maps each to a thulp_core::Parameter
  • AresMcpClient::list_tools() merges MCP transport tools with ares registry, MCP names taking precedence
  • Added with_registry, len, is_empty, has_tool passthroughs

Discovery from real integration

Real integration testing caught a behavior mismatch: ares Calculator uses {operation, a, b} structured params, not {expression} like the stub faked. Test updated to match reality.

Test plan

  • cargo check -p thulp-mcp --features ares — clean 7.5s
  • cargo test -p thulp-mcp --features ares — 50 tests pass (8 new ares + 39 existing + 3 doctests)
  • cargo test -p thulp-mcp (no feature) — 42 tests pass (feature gate works)

🤖 Generated with Claude Code

Replace the placeholder ares_integration.rs stub with a real integration
that wraps ares_server::ToolRegistry and exposes registered tools to
thulp via JSON Schema → thulp_core::ToolDefinition conversion.

Previously the "ares integration" module hardcoded four fake tool
definitions (calculator/web_search/file_read/file_write) with a TODO
comment "This would connect to ares-server's ToolRegistry" — it never
actually imported anything from ares-server. The `ares-server = "0.3.1"`
dep was declared but unused.

Now:
- Imports are via `ares::` (the library name in [lib] name = "ares"),
  NOT `ares_server::` (which is only the crates.io package name)
- AresToolRegistry holds a real ares::ToolRegistry internally
- with_default_tools() registers ares::tools::calculator::Calculator
- Optional `ares-search` feature registers WebSearch (requires
  ares-server/search-tools)
- get_all_tools() returns real ares tool definitions, converted via
  ares_to_thulp_definition() which walks the JSON Schema's properties
  map and creates thulp Parameters with type mapping
- AresMcpClient::list_tools() merges MCP transport tools with ares
  registry tools, with MCP names taking precedence
- Added AresToolRegistry::with_registry constructor for custom setups
- Added len/is_empty/has_tool passthroughs

Version bump: ares-server 0.3.1 → 0.7.2 (4 major versions, but since
nothing was actually using the old stub there are no real breaking
changes for consumers)

Tests:
- 8 ares_integration tests added (vs the 5 stub tests before)
- Real integration test caught a behavior mismatch: ares Calculator
  uses {operation, a, b} structured params, NOT {expression} string.
  The old stub had faked 'expression' — integration test fixed to
  match reality.
- Without --features ares: 42 tests pass (gate works correctly)
- With --features ares: 50 tests pass (8 new ares + 39 existing + 3 doc)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bkataru bkataru merged commit 979f7dc into master Apr 10, 2026
8 of 10 checks passed
@bkataru bkataru deleted the feat/real-ares-integration branch April 10, 2026 09:45
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.

1 participant