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.

Automatic tool selection. When a user sends a message, Claude analyzes the request and decides which tools to call, in what order, and how to combine their results. You never need to specify which tools to use.

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
CategoryToolsDescription
Shell2Execute commands and scripts
File4Read, write, list, and search files
Browser3Navigate, capture, and interact with web pages
Search2Web search and deep research
Vision4Image analysis, OCR, screenshots, webcam
File Generation7PDF, Word, Excel, PowerPoint, charts, diagrams, images
Rendering3Math, code highlighting, markdown
Media1Video summarization
Email8Inbox, 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.

Example prompt
"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.

Example prompt
"Check disk usage, find the largest files, and clean up temp directories"
// Claude generates and executes a multi-line bash script
💡
Security note: Shell tools respect the configured allowlist. You can restrict which commands are permitted by setting 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.

ToolDescription
read_fileRead the contents of a file. Supports text files, JSON, YAML, and more. Returns content with line numbers.
write_fileWrite or overwrite a file with new contents. Creates parent directories if they don't exist.
list_filesList files and directories at a given path. Supports recursive listing and glob pattern filtering.
search_filesSearch file contents using regular expressions. Returns matching lines with file paths and line numbers.
Example prompt
"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.

Example prompt
"Take a screenshot of the Hacker News front page and list the top 5 stories"
// Claude uses browse_web + screenshot_page, then summarizes
ℹ️
Playwright is optional. Browser tools require Playwright to be installed. Run 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.

Example prompt
"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.

ToolDescription
analyze_imageSend 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.
ocrExtract text from images with layout detection. Handles documents, receipts, screenshots, handwriting, and multi-column layouts. Returns structured text with position data.
screenshotCapture a screenshot of the current desktop or a specific window. Works on Linux (X11/Wayland), macOS, and Windows.
webcam_captureCapture an image from the connected webcam. Useful for visual check-ins, environment monitoring, or real-time analysis.
Example prompt
"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.

ToolOutputDescription
generate_pdf.pdfCreate PDF documents with text, tables, images, headers/footers, and custom styling. Supports multi-page layouts.
generate_word.docxCreate Word documents with formatted text, tables, images, and styles. Compatible with Microsoft Word and Google Docs.
generate_spreadsheet.xlsxCreate Excel spreadsheets with multiple sheets, formulas, formatting, charts, and data validation.
generate_presentation.pptxCreate PowerPoint presentations with slides, text, images, charts, and speaker notes.
generate_chart.png / .svgCreate charts and graphs: bar, line, pie, scatter, area, radar, and more. Uses Chart.js for rendering.
generate_diagram.png / .svgCreate diagrams: flowcharts, sequence diagrams, class diagrams, state machines, ER diagrams, and Gantt charts. Uses Mermaid.js.
generate_image.pngAI image generation via OpenAI's DALL-E. Create illustrations, icons, backgrounds, and concept art from text descriptions.
Example prompt
"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
💡
Tool chaining: Claude often combines generation tools. For example, asking for "a presentation about market trends" may trigger 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.

ToolDescription
render_mathRender 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_codeApply syntax highlighting to code snippets. Supports 100+ languages. Returns HTML with theme-aware styling. Uses Shiki for accurate tokenization.
render_markdownConvert Markdown to styled HTML. Supports GFM (GitHub Flavored Markdown), tables, task lists, footnotes, and embedded media.
Example prompt
"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.

Example prompt
"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.

TypeScript
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:

TypeScript
// 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.

Add tool definition to the TOOLS array

Open src/tools/index.ts and add your tool definition to the TOOLS array:

src/tools/index.ts
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 execution case in executeTool()

Add a case for your tool in the executeTool() function in the same file:

src/tools/index.ts
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
  };
}
Tool is automatically available to Claude

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.

No routing needed. Claude reads the tool name, description, and parameter schema to decide when and how to use each tool. Write a clear description and Claude will invoke it at the right time.