Tools
OpenSentinel includes 123 built-in tools that Claude can use to interact with your system, the web, and external services.
Overview
Tools are the capabilities that Claude can invoke to take action in the real world. They are defined in src/tools/index.ts and automatically registered when OpenSentinel starts. Claude selects and executes the right tools based on context — no manual routing required.
Key characteristics of the tool system:
- Sandboxed execution — All tools run in isolated contexts with configurable timeouts
- Allowlist / Blocklist — Configure which tools are available per user or per environment
- Extensible — Add custom tools with a simple definition format
- Composable — Claude can chain multiple tools together to complete complex tasks
| Category | Tools | Description |
|---|---|---|
| Shell | 2 | Execute commands and scripts |
| File | 4 | Read, write, list, and search files |
| Browser | 3 | Navigate, capture, and interact with web pages |
| Search | 2 | Web search and deep research |
| Vision | 4 | Image analysis, OCR, screenshots, webcam |
| File Generation | 7 | PDF, Word, Excel, PowerPoint, charts, diagrams, images |
| Rendering | 3 | Math, code highlighting, markdown |
| Media | 1 | Video summarization |
| 8 | Inbox, read, send, reply, forward, attachments, search, folders |
Shell Tools
Execute system commands and scripts directly from the AI assistant. Shell tools run in a sandboxed environment with configurable permissions.
execute_command
Run a single shell command and return its output. Commands are executed in a sandboxed shell with configurable timeout and working directory.
"List all running Docker containers"
// Claude executes: docker ps
run_script
Execute a multi-line script. Supports bash, Python, and other interpreters. Useful for complex operations that require multiple sequential commands.
"Check disk usage, find the largest files, and clean up temp directories"
// Claude generates and executes a multi-line bash script
ALLOWED_COMMANDS in your environment. By default, destructive commands like rm -rf / are blocked.File Tools
Full filesystem access with configurable boundaries. Claude can read, write, list, and search files within the allowed directories.
| Tool | Description |
|---|---|
read_file | Read the contents of a file. Supports text files, JSON, YAML, and more. Returns content with line numbers. |
write_file | Write or overwrite a file with new contents. Creates parent directories if they don't exist. |
list_files | List files and directories at a given path. Supports recursive listing and glob pattern filtering. |
search_files | Search file contents using regular expressions. Returns matching lines with file paths and line numbers. |
"Find all TODO comments in the src/ directory and write a summary to todos.md"
// Claude uses search_files to find TODOs, then write_file to create the summary
Browser Tools
Navigate the web, extract content, and interact with pages using headless browser automation powered by Playwright.
browse_web
Navigate to a URL and extract its content. Returns cleaned text, metadata, and optionally a screenshot. Handles JavaScript-rendered pages, cookie banners, and infinite scroll.
screenshot_page
Capture a full-page or viewport screenshot of any URL. Returns the image for analysis or inclusion in generated documents.
fill_form
Interact with web forms — fill inputs, select dropdowns, click buttons, and submit forms. Useful for automation workflows.
"Take a screenshot of the Hacker News front page and list the top 5 stories"
// Claude uses browse_web + screenshot_page, then summarizes
bunx playwright install chromium to set it up. If Playwright is not available, browse_web falls back to HTTP fetching with content extraction.Search Tools
Search the web using multiple engines and perform deep multi-query research with automatic synthesis.
web_search
Perform a web search using Google, DuckDuckGo, or Brave Search. Returns titles, URLs, and snippets from the top results. The search engine is configurable via environment variables.
research_mode
Deep research mode that executes multiple search queries, visits the most relevant pages, extracts key information, and synthesizes findings into a comprehensive summary. Ideal for competitive analysis, market research, or any topic requiring multiple sources.
"Research the current state of WebAssembly adoption and create a brief report"
// Claude uses research_mode: runs 3-5 queries, visits top results, synthesizes
Vision Tools
AI-powered image understanding, text extraction, and visual capture from screens and cameras.
| Tool | Description |
|---|---|
analyze_image | Send an image to the configured LLM's vision model for understanding. Describe contents, answer questions about the image, extract structured data from charts or diagrams. |
ocr | Extract text from images with layout detection. Handles documents, receipts, screenshots, handwriting, and multi-column layouts. Returns structured text with position data. |
screenshot | Capture a screenshot of the current desktop or a specific window. Works on Linux (X11/Wayland), macOS, and Windows. |
webcam_capture | Capture an image from the connected webcam. Useful for visual check-ins, environment monitoring, or real-time analysis. |
"Take a screenshot of my desktop and tell me what apps are open"
// Claude uses screenshot + analyze_image to describe the desktop
File Generation Tools
Generate professional documents, charts, diagrams, and images. All generated files are saved to the configured output directory and can be sent back through any channel.
| Tool | Output | Description |
|---|---|---|
generate_pdf | Create PDF documents with text, tables, images, headers/footers, and custom styling. Supports multi-page layouts. | |
generate_word | .docx | Create Word documents with formatted text, tables, images, and styles. Compatible with Microsoft Word and Google Docs. |
generate_spreadsheet | .xlsx | Create Excel spreadsheets with multiple sheets, formulas, formatting, charts, and data validation. |
generate_presentation | .pptx | Create PowerPoint presentations with slides, text, images, charts, and speaker notes. |
generate_chart | .png / .svg | Create charts and graphs: bar, line, pie, scatter, area, radar, and more. Uses Chart.js for rendering. |
generate_diagram | .png / .svg | Create diagrams: flowcharts, sequence diagrams, class diagrams, state machines, ER diagrams, and Gantt charts. Uses Mermaid.js. |
generate_image | .png | AI image generation via OpenAI's DALL-E. Create illustrations, icons, backgrounds, and concept art from text descriptions. |
"Create a PDF report about Q4 sales with a bar chart comparing monthly revenue"
// Claude uses generate_chart for the bar chart, then generate_pdf for the report
web_search + research_mode + generate_chart + generate_presentation in sequence.Rendering Tools
Render structured content into visual or formatted output for display or inclusion in documents.
| Tool | Description |
|---|---|
render_math | Render LaTeX mathematical expressions to PNG or SVG images. Supports equations, matrices, integrals, and all standard LaTeX math notation. Uses KaTeX for fast server-side rendering. |
highlight_code | Apply syntax highlighting to code snippets. Supports 100+ languages. Returns HTML with theme-aware styling. Uses Shiki for accurate tokenization. |
render_markdown | Convert Markdown to styled HTML. Supports GFM (GitHub Flavored Markdown), tables, task lists, footnotes, and embedded media. |
"Render the quadratic formula as an image"
// Claude uses render_math with LaTeX: x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}
Media Tools
Process and analyze media content including video files and streams.
summarize_video
Transcribe and summarize video content. Supports local files and YouTube URLs. Extracts audio, runs speech-to-text via Whisper, and generates a structured summary with timestamps, key points, and action items.
"Summarize this YouTube video: https://youtube.com/watch?v=..."
// Claude downloads audio, transcribes with Whisper, and generates a summary
Using Tools via Library
When using OpenSentinel as an NPM library, tools are available through the chatWithTools() function. Claude automatically selects and executes tools based on the user's request.
import { configure, chatWithTools } from 'opensentinel';
configure({ CLAUDE_API_KEY: process.env.CLAUDE_API_KEY });
const result = await chatWithTools([
{ role: 'user', content: 'Take a screenshot of hackernews.com and summarize the top stories' }
]);
console.log(result.text);
// "Here are today's top Hacker News stories: ..."
console.log(result.toolCalls);
// [{ tool: 'browse_web', ... }, { tool: 'screenshot_page', ... }]
You can also restrict which tools are available:
// Only allow search and file tools (no shell access)
const result = await chatWithTools(messages, {
allowedTools: ['web_search', 'read_file', 'write_file', 'search_files']
});
// Block specific tools
const result = await chatWithTools(messages, {
blockedTools: ['execute_command', 'run_script']
});
Adding Custom Tools
You can extend OpenSentinel with your own tools. Each tool is a simple object with a name, description, parameters schema, and an execution function.
Open src/tools/index.ts and add your tool definition to the TOOLS array:
export const TOOLS = [
// ... existing tools ...
{
name: 'check_weather',
description: 'Get current weather for a location',
input_schema: {
type: 'object',
properties: {
location: {
type: 'string',
description: 'City name or coordinates'
}
},
required: ['location']
}
}
];
Add a case for your tool in the executeTool() function in the same file:
case 'check_weather': {
const { location } = input;
const response = await fetch(
`https://wttr.in/${location}?format=j1`
);
const data = await response.json();
return {
temperature: data.current_condition[0].temp_C,
description: data.current_condition[0].weatherDesc[0].value,
humidity: data.current_condition[0].humidity
};
}
That's it. Restart OpenSentinel and your tool will be registered with Claude. When a user asks about weather, Claude will automatically select your check_weather tool.