Universal Agent Tools
Reusable tools and utilities extracted from the Universal Agent Nexus examples.
Overview
This package contains production-ready, reusable components for:
- Ollama + Tools Integration - Working pattern for Ollama LLMs with MCP tools
- Code Chunking - Multi-format intelligent chunking (Python, YAML, Markdown, JSON)
- MCP Server Framework - Base classes for creating MCP-compliant servers
- Tool Registry - Centralized tool discovery and management
- Codebase Analyzer - AST parsing, dependency graphs, PageRank scoring
- GitHub Integration - CLI-based GitHub operations
- Document Generator - Structured document generation
- Sync State Management - Generic sync state tracking
Installation
pip install universal-agent-tools
Or install with optional dependencies:
# With Qdrant support
pip install universal-agent-tools[qdrant]
# With GitHub API support
pip install universal-agent-tools[github]
# Development dependencies
pip install universal-agent-tools[dev]
Quick Start
Ollama + Tools
from universal_agent_tools.ollama_tools import (
MCPToolLoader,
create_llm_with_tools
)
# Load tools from MCP server
tools = MCPToolLoader.load_from_server("http://localhost:8000/mcp")
# Create LLM with tools
llm, tools = create_llm_with_tools(tools, model="qwen2.5-coder:14b")
Code Chunking
from universal_agent_tools.code_chunking import chunk_content
# Chunk any file type
chunks = chunk_content(content, "example.py")
# Each chunk has: type, name, content, line_start, line_end, docstring
for chunk in chunks:
print(f"{chunk['type']}: {chunk['name']} (lines {chunk['line_start']}-{chunk['line_end']})")
Tool Registry
from universal_agent_tools.tool_registry import get_registry
registry = get_registry()
registry.register_server("filesystem", "http://localhost:8000/mcp")
tools = registry.discover_tools()
for tool in registry.list_tools():
print(f"{tool.name}: {tool.description}")
Architecture
This package follows SOLID design principles:
- Single Responsibility - Each module has one clear purpose
- Open/Closed - Extensible without modification (e.g., custom chunkers)
- Liskov Substitution - Protocols/interfaces ensure substitutability
- Interface Segregation - Focused, minimal interfaces
- Dependency Inversion - Depend on abstractions, not concretions
Components
Priority 1 (Production-Ready)
- ollama_tools/ - Ollama + LangChain + MCP integration
- code_chunking/ - Multi-format chunking system
- mcp_framework/ - MCP server framework
Priority 2 (Well-Tested)
- tool_registry/ - Tool discovery system
- codebase_analyzer/ - AST analysis and dependency graphs
- github_tools/ - GitHub CLI integration
Priority 3 (Useful Patterns)
- document_generator/ - Structured document generation
- sync_state/ - Generic sync state tracking
Testing
# Run all tests
pytest
# With coverage
pytest --cov=universal_agent_tools
# Specific component
pytest tests/test_chunking.py
License
MIT License
Contributing
This package is extracted from universal_agent_nexus_examples.
See REFACTORING_ANALYSIS.md in the examples repo for extraction details.
Metadata
Release files for universal-agent-tools 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| universal_agent_tools-1.1.2.tar.gz | 40.3 kB | Without provenance | Details for universal_agent_tools-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| universal_agent_tools-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for universal_agent_tools-1.1.2-py3-none-any.whl |
Total release size: 93.7 kB
Release files / universal_agent_tools-1.1.2.tar.gz
| Download URL | universal_agent_tools-1.1.2.tar.gz |
|---|---|
| Size | 40.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64e997f9ece8c44a415b0faf2f4ae54074cf6d1b6a74ef5def4be8c54addcda6
|
|
BLAKE2b-256 checksum How to use checksums |
b4d95617362e3f4affd17e6a7e15d7d5f4cc9b08936b3258ec4e27e7cba2da42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / universal_agent_tools-1.1.2-py3-none-any.whl
| Download URL | universal_agent_tools-1.1.2-py3-none-any.whl |
|---|---|
| Size | 53.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8cf1fdb0ff0d5fd9718cc54b739f557b2f0bfcfeb97caececb485ef86fd5bc4
|
|
BLAKE2b-256 checksum How to use checksums |
3478b4fac2cd5e5ed018a47ad8e08cbb2604ae24ec78b9278db7d58f9913e841
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for universal-agent-tools 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.