A decentralized marketplace for agent capabilities - The Hands of AI Agents
Project description
ATR - Agent Tool Registry
"The Hands" - A decentralized marketplace for agent capabilities.
Core Value Proposition
ATR allows an agent to say, "I need a tool that can scrape websites," and receive a standardized interface, regardless of who built the tool or where it lives.
Installation
pip install agent-tool-registry
Quick Start
1. Register a Tool
Use the @atr.register() decorator to turn any Python function into a discoverable tool:
import atr
@atr.register(name="web_scraper", cost="low", tags=["web", "scraping"])
def scrape_website(url: str, timeout: int = 30) -> str:
"""Scrape content from a website.
Args:
url: The URL to scrape
timeout: Request timeout in seconds
"""
# Your implementation here
import requests
response = requests.get(url, timeout=timeout)
return response.text
Important: All parameters MUST have type hints - no magic arguments allowed!
2. Discover Tools
import atr
# Search for tools
tools = atr._global_registry.search_tools("scrape")
# List all tools with specific properties
web_tools = atr._global_registry.list_tools(tag="web")
low_cost_tools = atr._global_registry.list_tools(cost=atr.CostLevel.LOW)
3. Get Tool Specification
import atr
# Get the tool spec (doesn't execute it!)
tool_spec = atr._global_registry.get_tool("web_scraper")
# Convert to OpenAI function calling format
openai_schema = tool_spec.to_openai_function_schema()
print(openai_schema)
4. Execute a Tool (Control Plane's Job)
The registry does NOT execute tools - it only stores and returns them. Execution is the responsibility of the Agent Runtime (Control Plane):
import atr
# Get the callable (but don't execute yet!)
scraper_func = atr._global_registry.get_callable("web_scraper")
# Now the Agent Runtime can execute it with proper error handling
try:
result = scraper_func(url="https://example.com", timeout=10)
print(result)
except Exception as e:
# Handle errors in the Control Plane
print(f"Tool execution failed: {e}")
Architecture
The Spec
A rigorous Pydantic schema defines:
- Inputs: Strictly typed parameters (no magic arguments!)
- Outputs: Return value specification
- Side Effects: What the tool does (read, write, network, etc.)
- Metadata: Name, description, cost, version, author, tags
The Registry
A lightweight lookup mechanism (local dictionary-based):
- Stores tool specifications
- Enables tool discovery and search
- Returns function objects (doesn't execute them)
The Decorator
@atr.register() decorator that:
- Auto-extracts function signature
- Converts to ToolSpec schema
- Validates type hints are present
- Registers in the global registry
- Returns original function unchanged
Key Design Principles
✅ Do's
- Use strict typing: Every parameter must have a type hint
- Keep it simple: Registry is just a lookup mechanism
- Separate concerns: Registry stores, Agent Runtime executes
❌ Don'ts (Anti-Patterns)
- Don't execute tools in the registry: Return the function, don't call it
- Don't allow magic arguments: All parameters must be typed
- Don't hardcode specific agents: Tools are standalone functions
Supported Types
Parameters can be any of these types:
str→ ParameterType.STRINGint→ ParameterType.INTEGERfloat→ ParameterType.NUMBERbool→ ParameterType.BOOLEANlist→ ParameterType.ARRAYdict→ ParameterType.OBJECT
Advanced Usage
Custom Registry
from atr import Registry, register
# Create a custom registry
my_registry = Registry()
@register(name="custom_tool", registry=my_registry)
def my_tool(data: str) -> str:
return data.upper()
Tool Metadata
import atr
@atr.register(
name="file_reader",
cost="low",
side_effects=["read", "filesystem"],
tags=["file", "io"],
version="1.0.0",
author="Your Name"
)
def read_file(path: str, encoding: str = "utf-8") -> str:
"""Read a file from disk."""
with open(path, "r", encoding=encoding) as f:
return f.read()
OpenAI Function Calling Integration
import atr
# Get tool spec
tool_spec = atr._global_registry.get_tool("file_reader")
# Convert to OpenAI format
function_schema = tool_spec.to_openai_function_schema()
# Use with OpenAI API
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[{"role": "user", "content": "Read config.json"}],
functions=[function_schema],
)
Dependencies
pydantic>=2.0.0- For schema validation- Python standard library only
Strictly forbidden dependencies:
- ❌ agent-control-plane (tools are standalone)
- ❌ mute-agent (no hardcoded agents)
Contributing
Contributions are welcome! Please ensure:
- All parameters have type hints
- Registry doesn't execute tools
- No forbidden dependencies are added
- Tests pass
License
MIT License
Layer
Infrastructure (Layer 2)
Repository
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_tool_registry-0.1.0.tar.gz.
File metadata
- Download URL: agent_tool_registry-0.1.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cef2a69250e7a37627f2ff36954cff67a6dada338b3f3f51843efb407fd01112
|
|
| MD5 |
d454f87016fafa8001eb4fd97cf97849
|
|
| BLAKE2b-256 |
d4c7db71ea5eca38fc19bc8bf6eb83c278e9e93341083f7dc84c6bf07d068243
|
Provenance
The following attestation bundles were made for agent_tool_registry-0.1.0.tar.gz:
Publisher:
publish.yml on imran-siddique/atr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_tool_registry-0.1.0.tar.gz -
Subject digest:
cef2a69250e7a37627f2ff36954cff67a6dada338b3f3f51843efb407fd01112 - Sigstore transparency entry: 848886665
- Sigstore integration time:
-
Permalink:
imran-siddique/atr@3841fc24a362dc12ca4d7ad3cae761c4230bbe8b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/imran-siddique
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3841fc24a362dc12ca4d7ad3cae761c4230bbe8b -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_tool_registry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_tool_registry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d23428c4d1a4aad39855b70ff7d5abca81287f133f86ee5142da8ecda3a31098
|
|
| MD5 |
29289b0a1c71b6ef63847c0a1990e391
|
|
| BLAKE2b-256 |
8a7ca6b46eb002fb6c4f61c81e46d382f4920a08d02e6b7bb9351ff5e16044e6
|
Provenance
The following attestation bundles were made for agent_tool_registry-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on imran-siddique/atr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_tool_registry-0.1.0-py3-none-any.whl -
Subject digest:
d23428c4d1a4aad39855b70ff7d5abca81287f133f86ee5142da8ecda3a31098 - Sigstore transparency entry: 848886669
- Sigstore integration time:
-
Permalink:
imran-siddique/atr@3841fc24a362dc12ca4d7ad3cae761c4230bbe8b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/imran-siddique
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3841fc24a362dc12ca4d7ad3cae761c4230bbe8b -
Trigger Event:
release
-
Statement type: