scripts/prompt-templates/create-tool-template.md
I'm developing Leon AI, an open-source personal AI assistant. It has a granular structure: skills > actions > tools > functions (> binaries).
Your goal is to create a new tool. This tool is going to be used by skill actions. Tools are represented by a class and it contains methods (functions), you must create them.
You must strictly follow the purpose requirement and technical requirements.
This leon-ai/leon repository already contains several tools. Feel free to use these existing binaries for your reference to get a better understanding.
You must create a new tool for {TOOL_ALIAS_NAME}. {TOOL_DESCRIPTION}
{TOOL_PURPOSE_REQUIREMENT}
bridges/nodejs/src/sdk/tools and bridges/python/src/sdk/tools.{TOOL_TOOLKIT_NAME} toolkit.bridges/toolkits/{TOOL_TOOLKIT_NAME}/tools/{TOOL_NAME}.tool.json file. You must provide the description, binaries, resources, function definitions by following the OpenAI function-calling standard, etc. Create the file is not created yet.{TOOL_TS_FILE_NAME} and {TOOL_PYTHON_FILE_NAME}.sdk/base-tool.ts and sdk/base_tool.py.If a tool relies on a binary from leon-ai/leon-binaries, you must follow these requirements:
README.md file.run_*.py file.For example, for the qwen3_tts tool, the README file is located at https://raw.githubusercontent.com/leon-ai/leon-binaries/refs/heads/main/bins/qwen3_tts/README.md and the source code file is located at https://raw.githubusercontent.com/leon-ai/leon-binaries/refs/heads/main/bins/qwen3_tts/run_qwen3_tts.py
--torch_path, then use the PYTORCH_TORCH_PATH constant from the bridge constants file. You can look at the qwen3_asr-tool.ts and qwen3_asr_tool.py for reference.--nvidia_libs_path, then use the NVIDIA_LIBS_PATH constant from the bridge constants file. You can look at the qwen3_asr-tool.ts and qwen3_asr_tool.py for reference.--resource_path, then use this.getResourcePath() and self.get_resource_path(). You can look at the qwen3_asr-tool.ts and qwen3_asr_tool.py for reference.Some tools rely on binaries (mostly CLIs), some run HTTP API calls, some other RPC, etc.
For your reference and to have a deeper understanding about how tools must be written, you must look at existing tools such as: qwen3_asr-tool.ts, qwen3_asr_tool.py, ecapa-tool.ts, ecapa_tool.py, openai_audio-tool.ts, openai_audio_tool.py, ytdlp-tool.ts, ytdlp_tool.py and many others.