Tools Module¶
The tools module implements the tool system used by agents for executing
actions such as calculations, memory search, file reading, and sub-model
queries. Each tool implements the BaseTool ABC and is registered via
@ToolRegistry.register("name"). The ToolExecutor dispatches tool calls
with JSON argument parsing, latency tracking, and event bus integration.
Abstract Base Class¶
BaseTool¶
BaseTool
¶
Bases: ABC
Base class for all tool implementations.
Subclasses must be registered via
@ToolRegistry.register("name") to become discoverable.
Attributes¶
Functions¶
execute
abstractmethod
¶
execute(**params: Any) -> ToolResult
to_openai_function
¶
Convert to OpenAI function-calling format.
Source code in src/openjarvis/tools/_stubs.py
ToolSpec¶
ToolSpec
dataclass
¶
ToolSpec(name: str, description: str, parameters: Dict[str, Any] = dict(), category: str = '', cost_estimate: float = 0.0, latency_estimate: float = 0.0, requires_confirmation: bool = False, metadata: Dict[str, Any] = dict())
Declarative description of a tool's interface and characteristics.
ToolExecutor¶
ToolExecutor
¶
ToolExecutor(tools: List[BaseTool], bus: Optional[EventBus] = None, *, interactive: bool = False, confirm_callback: Optional[Callable[[str], bool]] = None)
Dispatch tool calls to registered tools with event bus integration.
| PARAMETER | DESCRIPTION |
|---|---|
tools
|
List of tool instances to make available.
TYPE:
|
bus
|
Optional event bus for publishing
TYPE:
|
Source code in src/openjarvis/tools/_stubs.py
Functions¶
execute
¶
execute(tool_call: ToolCall) -> ToolResult
Parse arguments, dispatch to tool, measure latency, emit events.
Source code in src/openjarvis/tools/_stubs.py
get_openai_tools
¶
build_tool_descriptions¶
build_tool_descriptions
¶
build_tool_descriptions(tools: List[BaseTool], *, include_category: bool = True, include_cost: bool = False) -> str
Build rich text descriptions from a list of tools.
This is the single source of truth for all text-based agents that need to describe available tools in their system prompts.
| PARAMETER | DESCRIPTION |
|---|---|
tools
|
List of tool instances.
TYPE:
|
include_category
|
Whether to include the
TYPE:
|
include_cost
|
Whether to include
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Formatted multi-tool description, or |
Source code in src/openjarvis/tools/_stubs.py
Built-in Tools¶
CalculatorTool¶
safe_eval¶
safe_eval
¶
ThinkTool¶
RetrievalTool¶
RetrievalTool
¶
RetrievalTool(backend: Optional[MemoryBackend] = None, *, top_k: int = 5)
LLMTool¶
LLMTool
¶
LLMTool(engine: Optional[InferenceEngine] = None, *, model: str = '')
FileReadTool¶
FileReadTool
¶
Storage Tools¶
Tools that expose memory storage operations for use by agents via the tool
system. These wrap the memory backend methods as BaseTool implementations.
MemoryStoreTool¶
MemoryStoreTool
¶
MemoryStoreTool(backend: MemoryBackend | None = None)
MemoryRetrieveTool¶
MemoryRetrieveTool
¶
MemoryRetrieveTool(backend: MemoryBackend | None = None)
MemorySearchTool¶
MemorySearchTool
¶
MemorySearchTool(backend: MemoryBackend | None = None)
MemoryIndexTool¶
MemoryIndexTool
¶
MemoryIndexTool(backend: MemoryBackend | None = None)
Scheduler Tools¶
MCP tools for scheduling agent tasks for future or recurring execution. All five tools are in the scheduler category and require a TaskScheduler instance to be injected at _scheduler. For usage and schedule type examples see the Scheduler Tools user guide.
ScheduleTaskTool¶
ListScheduledTasksTool¶
PauseScheduledTaskTool¶
ResumeScheduledTaskTool¶
CancelScheduledTaskTool¶
MCP Adapter¶
Integration with the Model Context Protocol (MCP). The MCP adapter exposes OpenJarvis tools as MCP-compatible resources and allows consuming external MCP tool providers. Supports MCP protocol version 2025-11-25.
MCPToolAdapter¶
MCPToolAdapter
¶
MCPToolAdapter(client: MCPClient, tool_spec: ToolSpec)
Bases: BaseTool
Wraps a single MCP-hosted tool as a native BaseTool.
This adapter enables tools discovered from external MCP servers to
be used seamlessly within OpenJarvis agents via the ToolExecutor.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
The
TYPE:
|
tool_spec
|
The
TYPE:
|
Source code in src/openjarvis/tools/mcp_adapter.py
Functions¶
execute
¶
execute(**params: Any) -> ToolResult
Execute the remote MCP tool and return a ToolResult.
Source code in src/openjarvis/tools/mcp_adapter.py
MCPToolProvider¶
MCPToolProvider
¶
Discovers tools from an MCP server and returns BaseTool adapters.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
The
TYPE:
|