Skip to content

Custom Toolset

Load custom toolset implementations from Python code.

Basic Usage

agents:
  my_agent:
    toolsets:
      - type: custom
        import_path: mypackage.toolsets:MyCustomToolset

Creating a Custom Toolset

from llmling_agent.resource_providers import ResourceProvider

class MyCustomToolset(ResourceProvider):
    async def get_tools(self):
        return [
            self.create_tool(self.my_tool, category="custom")
        ]

    async def my_tool(self, ctx, param: str) -> str:
        """My custom tool description."""
        return f"Result: {param}"

Configuration Reference

Custom Toolset

Configuration for custom toolsets.

Custom Toolset (YAML)
1
2
3
4
toolsets:
- type: custom
  import_path: myapp.toolsets.CustomTools  # Dotted import path to the custom toolset implementation class.
  namespace: null  # Optional namespace prefix for tool names