Remote Tools from GitHub
Step-by-step guide to using tools from GitHub and remote URLs
Pull tool implementations from GitHub URLs and reference them in template manifests.
from praisonaiagents import Agent, tool
agent = Agent(name="Remote Tools", instructions="Use tools loaded from remote sources.")
agent.start("Which remote tool sources are configured?")The user adds tools_sources entries, lists tools in agents.yaml, and runs the template.
How It Works
How to Reference Tools from GitHub
- Add GitHub URL to tools_sources
yaml # TEMPLATE.yaml name: my-template version: "1.0.0" requires: tools_sources: - github:MervinPraison/PraisonAI-tools/praisonai_tools/video - Reference Tools in agents.yaml
yaml roles: agent: tools: - shell_tool tasks: main: description: "Use video tools from GitHub" - Run Template
bash praisonai templates run ./my-template
How to Use Tools from Raw GitHub URLs
- Get Raw URL
Navigate to the tools.py file on GitHub and click “Raw” to get the raw URL:
https://raw.githubusercontent.com/MervinPraison/PraisonAI-tools/main/tools.py - Add to tools_sources
yaml # TEMPLATE.yaml requires: tools_sources: - https://raw.githubusercontent.com/user/repo/main/tools.py - Run Template
bash praisonai templates run ./my-template
How to Use Tools via CLI Override
- Run with Remote Tool Source
bash praisonai templates run my-template \ --tools-source github:MervinPraison/PraisonAI-tools/praisonai_tools - Run with Multiple Sources
bash praisonai templates run my-template \ --tools-source github:user/repo/tools \ --tools-source ./local_tools.py
How to Install Tools from PyPI
- Install Package
bash pip install praisonai-tools - Add to tools_sources
yaml # TEMPLATE.yaml requires: packages: - praisonai-tools tools_sources: - praisonai_tools.video - Use Tools
bash praisonai templates run ./my-template
How to Create Shareable Tool Packages
- Create Package Structure
my-tools/ ├── pyproject.toml ├── my_tools/ │ ├── __init__.py │ └── tools.py - Define pyproject.toml
The canonical entry-point group is
praisonai.tools. The legacypraisonaiagents.toolsandpraisonai.tool_sourcesgroups are kept as one-cycle deprecated aliases — new tool packages should publish underpraisonai.tools.toml [project] name = "my-tools" version = "1.0.0" [project.entry-points."praisonai.tools"] my_tools = "my_tools:tools" - Publish to PyPI
bash pip install build twine python -m build twine upload dist/* - Use in Templates
yaml requires: packages: - my-tools tools_sources: - my_tools
Remote Tool Source Formats
| Format | Example |
|---|---|
| GitHub shorthand | github:user/repo/path |
| GitHub with branch | github:user/repo/path@branch |
| Raw URL | https://raw.githubusercontent.com/... |
| PyPI package | package_name.module |
| Local path | ./tools.py or ./tools_dir/ |
Best Practices
Pin a branch or tag for reproducibility
Append @branch to a github: source so a run does not silently change when the upstream repo updates.
Review remote tool code before enabling
Remote tools run in your process. Read the implementation and restrict what it can do before adding it to tools_sources.
Prefer packaged tools for anything shared
Publishing to PyPI and referencing package_name.module gives you versioning and dependency management that raw URLs lack.