๐ง BaseTool โ The Contract
BaseTool is the interface that makes the tool system extensible. Four Required Attributes and the LLM already knows how to use the tool.
๐ BaseTool Interface
- โขname: str โ unique identifier ('google_calendar')
- โขdescription: str โ for the LLM to decide when to use it
- โขparameters: dict โ JSON Schema for the arguments
- โขasync execute(**kwargs) -> str โ implementation
- โขregistry.py automatically discovers tools in tools/
๐ก Practical Tip
Write the description as if it were for an intelligent human. The LLM reads exactly this to decide when to call the tool.
๐ Registry and Automatic Discovery
registry.py uses Python reflection to automatically discover all classes that extend BaseTool. No manual registration code.
๐ How Auto-Discovery Works
- โขScans all files in tools/*.py
- โขImport each module with importlib.import_module()
- โขInspects classes with inspect.getmembers()
- โขFilter for BaseTool subclasses with issubclass()
- โขInstantiates and registers in the tool_registry dict
๐ก Practical Tip
Put a tool in tools/ and restart Jarvis. It becomes available automatically. No need to edit Agent or manually edit the registry.
๐ Google Workspace
Google Workspace integration connects Jarvis to the world's most common productivity infrastructure. Calendar, Drive, Gmail, and Sheets in native tools.
๐ Google Workspace Tools
- โขGoogleCalendarTool: create, list, update, and cancel events
- โขGoogleDriveTool: upload, download, search, and share files
- โขGmailTool: read, send, archive, and categorize emails
- โขGoogleSheetsTool: read and write spreadsheets
- โขAuthentication: OAuth2 with automatic token refresh
๐ก Practical Tip
Use service accounts for automation without human interaction. For personal use, OAuth2 with a token saved in .secrets is simpler.
๐ GitHub Integration
The GitHubTool turns Jarvis into a development collaborator. Issues, PRs, commits, and code search via API.
๐ GitHub Capabilities
- โขList and create issues with labels and assignees
- โขReview PRs: view diffs, comment, approve, or request changes
- โขSearch code by default in a specific repository
- โขMake simple commits (e.g., update a config file)
- โขCheck CI/CD status on the latest commit
๐ก Practical Tip
Configure GITHUB_TOKEN with the minimum required scope. For read-only access, use only 'repo:read'. For write access, add the full 'repo' scope.
๐ BrowserTool โ Web Scraping
BrowserTool uses headless Playwright to give Jarvis real-time access to the web. Search, extract, and browse with user approval.
๐ Browser Capabilities
- โขweb_search(): searches DuckDuckGo or Google with structured results
- โขfetch_page(): extracts text from any URL (with injection detection)
- โขtake_screenshot(): visual capture of pages for analysis
- โขfill_form(): fills out forms with explicit approval
- โขAll actions go through the level 2 approval gate
๐ก Practical Tip
Always run web page content through the injection scanner before adding it to the context. Malicious pages may contain indirect injection.
โก Creating Custom Tools
The INTELECTO extension model is deliberately simple. Fewer than 50 lines to turn any API into a Jarvis tool.
๐ Tool Template in 5 Steps
- โข1. Create tools/minha_tool.py
- โข2. from intelecto.tools.base import BaseTool
- โข3. class MinhaTool(BaseTool):
- โข4. Define name, description, parameters (JSON Schema)
- โข5. async def execute(**kwargs) -> str: # your logic
๐ก Practical Tip
The description parameter is the most important. Write it like a function docstring: what it does, when to use it, and what it returns. The LLM reads it literally.
โ Module 4.2 Summary
Next:
4.3 Automation and Webhooks