Universal Tools & MCP Support#278
Merged
TonsOfFun merged 17 commits intoactiveagents:mainfrom Nov 25, 2025
Merged
Conversation
e880825 to
5defe6b
Compare
5defe6b to
205852a
Compare
205852a to
7255037
Compare
…usage when in json_object mode
There was a problem hiding this comment.
Pull request overview
This PR introduces universal tool definitions and MCP (Model Context Protocol) support, enabling developers to write tool definitions once and use them across all providers. It adds automatic format conversion, standardizes tool choice logic, and implements MCP server connectivity for external services.
Key Changes:
- Universal tool format with automatic provider-specific conversion
- MCP server integration for Anthropic and OpenAI
- Refactored tool choice logic to prevent infinite loops
Reviewed changes
Copilot reviewed 73 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/fixtures/vcr_cassettes/integration/open_router/common_format/tools_test/test_agent_common_format_input_schema.yml | VCR cassette for OpenRouter common format tool testing |
| test/fixtures/vcr_cassettes/integration/open_ai/responses/*.yml | VCR cassettes for OpenAI Responses API with tools and MCP |
| test/fixtures/vcr_cassettes/integration/open_ai/chat/common_format/tools_test/*.yml | VCR cassettes for OpenAI Chat API common format tool testing |
| test/fixtures/vcr_cassettes/integration/ollama/chat/common_format/tools_test/test_agent_common_format_tool_choice_specific.yml | VCR cassette for Ollama common format tool choice testing |
| test/docs/actions_examples_test.rb | Added MCP example and removed redundant type field from tool definition |
| lib/active_agent/providers/open_router_provider.rb | Added tool preparation and tool_choice_forces_required? method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Write tool definitions once, use everywhere. Connect to external services via MCP.
Tools: One Format, All Providers
Before: 4 different formats across providers
After: Single format auto-converts to native formats
Backwards compatible: Old formats still work
Auto-Conversion
parameters→input_schema(gem models)"required"→"any"Refactoring
Unified tool choice logic prevents infinite loops:
Tests: 30 integration tests, 47 VCR cassettes, 0 failures
MCP: Connect External Services
Common format:
{name, url, authorization}→ auto-converts to:{type: "url", name, url, authorization_token}{type: "mcp", server_label, server_url, authorization}Features:
mcpsormcp_serversDocs:
/actions/mcpswith 8 tested examplesTests: 25 tests (14 unit + 11 integration), real MCP servers
Bug fix: Corrected Anthropic native format detection
Migration
No breaking changes: