ToolRegistry: A Protocol-Agnostic Tool Management Library for Function-Calling LLMs
Problem Statement
LLM applications increasingly depend on external tools, but current integration approaches are fragmented across incompatible protocols (e.g., OpenAI, Anthropic, MCP), require significant boilerplate code, and impose high implementation complexity. This fragmentation creates substantial development overhead and reduces code maintainability, slowing down the deployment of tool-augmented LLM systems. There is no unified abstraction that allows developers to define tools once and deploy them across multiple LLM backends without rewriting integration logic.
Key Novelty
- Protocol-agnostic unified interface that abstracts over multiple LLM tool-calling protocols, enabling write-once-deploy-anywhere tool definitions
- Concurrent tool execution engine that achieves up to 3.1x performance improvement by parallelizing independent tool calls
- Significant reduction (60-80%) in tool integration boilerplate code through automated schema generation, lifecycle management, and standardized registration APIs
Evaluation Highlights
- 60-80% reduction in tool integration code volume compared to manual/native integration approaches across diverse scenarios
- Up to 3.1x performance improvement through concurrent execution of parallel tool calls, with 100% compatibility with OpenAI function calling standards
Breakthrough Assessment
Methodology
- Define a unified tool registration API that accepts Python functions, classes, or remote endpoints and automatically extracts metadata (name, description, JSON schema) via introspection and docstring parsing
- Implement a protocol translation layer that serializes tool definitions into formats compatible with multiple LLM providers (e.g., OpenAI, Anthropic) and manages the full tool lifecycle including invocation and result handling
- Introduce a concurrent execution engine that identifies parallelizable tool calls from LLM responses and dispatches them simultaneously, then aggregates results before returning to the model
System Components
Central registry object that stores, indexes, and manages all registered tools, providing lookup and enumeration APIs for downstream LLM clients
Decorator and function-based interface to register Python callables as tools, with automatic JSON schema generation from type hints and docstrings
Serialization layer that converts internal tool representations into provider-specific formats (e.g., OpenAI function-calling schema), ensuring cross-platform compatibility
Parallel dispatch engine that executes multiple tool calls simultaneously when the LLM requests independent tools, reducing end-to-end latency by up to 3.1x
Handles tool invocation, error handling, result formatting, and cleanup, abstracting low-level execution details from application developers
Results
| Metric/Benchmark | Baseline (Manual Integration) | ToolRegistry | Delta |
|---|---|---|---|
| Lines of tool integration code | Baseline (100%) | 20-40% of baseline | -60% to -80% |
| Execution time (parallel tools) | Sequential baseline (1x) | Up to 3.1x faster | +3.1x speedup |
| OpenAI function-calling compatibility | N/A | 100% | Full compliance |
| Code maintainability (qualitative) | Fragmented, protocol-specific | Unified, protocol-agnostic | Significant improvement |
Key Takeaways
- ML practitioners building tool-augmented LLM applications can use ToolRegistry to dramatically cut boilerplate, registering tools as simple Python functions with decorators and getting automatic schema generation for free
- For latency-sensitive agentic pipelines where the LLM requests multiple tools per turn, ToolRegistry's concurrent executor can provide up to 3.1x speedup with no additional application-level code changes
- ToolRegistry's protocol-agnostic design allows teams to switch or support multiple LLM providers (e.g., move from OpenAI to a local model) without rewriting tool definitions, reducing vendor lock-in risk
Abstract
Large Language Model (LLM) applications are increasingly relying on external tools to extend their capabilities beyond text generation. However, current tool integration approaches suffer from fragmentation, protocol limitations, and implementation complexity, leading to substantial development overhead. This paper presents Toolregistry, a protocol-agnostic tool management library that simplifies tool registration, representation, execution, and lifecycle management via a unified interface. Our evaluation demonstrates that \toolregistry achieves 60-80% reduction in tool integration code, up to 3.1x performance improvements through concurrent execution, and 100% compatibility with OpenAI function calling standards. Real-world case studies show significant improvements in development efficiency and code maintainability across diverse integration scenarios. \toolregistry is open-source and available at https://github.com/Oaklight/ToolRegistry, with comprehensive documentation at https://toolregistry.readthedocs.io/.