Universal Tool Calling Protocol (UTCP) community plugin for Strands Agents SDK
- Universal Tool Access - Connect to any UTCP-compatible tool source
- OpenAPI/Swagger Support - Automatic tool discovery from API specifications
- Multiple Sources - Connect to multiple tool sources simultaneously
- Async/Await Support - Full async support with context managers
- Type Safe - Full type hints and validation
- Easy Integration - Drop-in tool adapter for Strands agents
Key Technical Features:
- AgentTool Inheritance: Full inheritance from Strands
AgentTool
base class - Tool Name Sanitization: UUID suffixes for names >64 characters (Bedrock requirement)
- Python 3.10+
- Strands Agents SDK 1.7.0+
- UTCP core libraries 1.0+
pip install strands-agents strands-utcp
from strands import Agent
from strands_utcp import UtcpToolAdapter
# Configure UTCP tool adapter
config = {
"manual_call_templates": [
{
"name": "weather_api",
"call_template_type": "http",
"url": "https://api.weather.com/utcp",
"http_method": "GET"
}
]
}
# Use UTCP tools with Strands agent
async def main():
async with UtcpToolAdapter(config) as adapter:
# Get available tools
tools = adapter.list_tools()
print(f"Found {len(tools)} UTCP tools")
# Create agent with UTCP tools
agent = Agent(tools=adapter.to_strands_tools())
# Use the agent
response = await agent.invoke_async("What's the weather like today?")
print(response.message)
import asyncio
asyncio.run(main())
async with UtcpToolAdapter(config) as adapter:
# List all available tools
all_tools = adapter.list_tools()
# Search for specific tools
weather_tools = await adapter.search_tools("weather")
# Get a specific tool
weather_tool = adapter.get_tool("get_weather")
if weather_tool:
result = await weather_tool.call(location="New York")
print(result)
config = {
"manual_call_templates": [
{
"name": "petstore",
"call_template_type": "http",
"url": "https://petstore.swagger.io/v2/swagger.json"
},
{
"name": "openlibrary",
"call_template_type": "http",
"url": "https://openlibrary.org/static/openapi.json"
}
]
}
async with UtcpToolAdapter(config) as adapter:
tools = adapter.list_tools()
print(f"Total tools from all sources: {len(tools)}")
The plugin supports all UTCP call template types:
{
"name": "api_name",
"call_template_type": "http",
"url": "https://api.example.com/utcp",
"http_method": "GET", # GET, POST, PUT, DELETE
"content_type": "application/json"
}
{
"name": "sse_stream",
"call_template_type": "sse",
"url": "https://api.example.com/stream",
"http_method": "GET"
}
{
"name": "http_stream",
"call_template_type": "streamable_http",
"url": "https://api.example.com/stream",
"http_method": "POST"
}
{
"name": "cli_tool",
"call_template_type": "cli",
"command": "python script.py"
}
{
"name": "graphql_api",
"call_template_type": "graphql",
"url": "https://api.example.com/graphql"
}
{
"name": "mcp_server",
"call_template_type": "mcp",
"command": "node mcp-server.js"
}
{
"name": "tcp_service",
"call_template_type": "tcp",
"host": "localhost",
"port": 8080
}
{
"name": "udp_service",
"call_template_type": "udp",
"host": "localhost",
"port": 8081
}
{
"name": "text_tools",
"call_template_type": "text",
"file_path": "/path/to/tools.txt"
}
Main adapter class for UTCP tool integration.
start()
- Initialize the UTCP clientstop()
- Clean up resourceslist_tools()
- Get all available toolsget_tool(name)
- Get specific tool by namesearch_tools(query, max_results)
- Search for toolscall_tool(name, arguments)
- Execute a toolto_strands_tools()
- Convert to Strands tool format
Wrapper for individual UTCP tools.
name
- Tool name (sanitized)description
- Tool descriptioninput_schema
- JSON Schema for inputs
call(**kwargs)
- Execute the tool
Exception raised for UTCP-specific errors.
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=strands_utcp --cov-report=html
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built for the UTCP and Strands communities 🚀