feat: real ares-server integration (0.3.1 → 0.7.2)#16
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the placeholder
ares_integration.rsstub with a real wrapper aroundares::ToolRegistryand bumpsares-server0.3.1 → 0.7.2.The previous stub hard-coded four fake tool definitions and had a
TODOcomment "This would connect to ares-server's ToolRegistry" — it never actually imported anything. Theares-server = "0.3.1"dep was declared but unused.Key changes
ares::(per[lib] name = "ares"in ares Cargo.toml), NOTares_server::(which is only the crates.io package name)AresToolRegistryholds a realares::ToolRegistryinternallywith_default_tools()registersares::tools::calculator::Calculatorares-searchfeature registersWebSearch(gated byares-server/search-tools)get_all_tools()returns real ares tool definitions, converted viaares_to_thulp_definition()which walks JSON Schemapropertiesand maps each to athulp_core::ParameterAresMcpClient::list_tools()merges MCP transport tools with ares registry, MCP names taking precedencewith_registry,len,is_empty,has_toolpassthroughsDiscovery 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.5scargo 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