Skip to main content
A ready-to-run example is available here!
When using a remote agent server, custom tools must be available in the server’s Python environment. This guide shows how to build a custom base image with your tools and use DockerDevWorkspace to automatically build the agent server on top of it.
For standalone custom tools (without remote agent server), see the Custom Tools guide.

How It Works

  1. Define custom tool with register_tool() at module level
  2. Create Dockerfile that copies tools and sets PYTHONPATH
  3. Build custom base image with your tools
  4. Use DockerDevWorkspace with base_image parameter - it builds the agent server on top
  5. Import tool module in client before creating conversation
  6. Server imports modules dynamically, triggering registration

Key Files

Custom Tool (custom_tools/log_data.py)

examples/02_remote_agent_server/06_custom_tool/custom_tools/log_data.py

Dockerfile

Troubleshooting

IssueSolution
Tool not foundEnsure register_tool() is called at module level, import tool before creating conversation
Import errors on serverCheck PYTHONPATH in Dockerfile, verify all dependencies installed
Build failuresVerify file paths in COPY commands, ensure Python 3.12+
Binary Mode Limitation: Custom tools only work with source mode deployments. When using DockerDevWorkspace, set target="source" (the default). See GitHub issue #1531 for details.

Ready-to-run Example

This example is available on GitHub: examples/02_remote_agent_server/06_custom_tool/
examples/02_remote_agent_server/06_custom_tool/main.py
Running the Example

Next Steps