Skip to main content

Tools Configuration

PicoClaw's tools configuration is located in the tools field of config.json.

{
"tools": {
"web": { ... },
"mcp": { ... },
"exec": { ... },
"cron": { ... },
"skills": { ... }
}
}

Sensitive Data Filtering

Before tool results are sent to the LLM, PicoClaw can filter sensitive values (API keys, tokens, secrets) from the output. This prevents the LLM from seeing its own credentials.

See Sensitive Data Filtering for full documentation.

ConfigTypeDefaultDescription
filter_sensitive_databooltrueEnable/disable filtering
filter_min_lengthint8Minimum content length to trigger filtering

Web Tools

Web tools are used for web search and fetching.

In config schema 2, brave, tavily, and perplexity use api_keys (array). Their api_key field in config.json is ignored.

Web Fetcher

General settings for fetching and processing webpage content.

ConfigTypeDefaultDescription
enabledbooltrueEnable the webpage fetching capability
fetch_limit_bytesint10485760Maximum size of the webpage payload to fetch, in bytes (default is 10MB)
formatstring"plaintext"Output format of the fetched content. Options: plaintext or markdown (recommended)
ConfigTypeDefaultDescription
enabledboolfalseEnable Brave search
api_keysstring[]--One or more Brave Search API keys for rotation
max_resultsint5Maximum number of results

Get a free API key at brave.com/search/api (2000 free queries/month).

DuckDuckGo

ConfigTypeDefaultDescription
enabledbooltrueEnable DuckDuckGo search
max_resultsint5Maximum number of results

DuckDuckGo is enabled by default and requires no API key.

Baidu Search uses the Qianfan AI Search API, which is AI-powered and optimized for Chinese-language queries.

ConfigTypeDefaultDescription
enabledboolfalseEnable Baidu Search
api_keystring--Qianfan API key
base_urlstringhttps://qianfan.baidubce.com/v2/ai_search/web_searchBaidu Search API URL
max_resultsint5Maximum number of results
{
"tools": {
"web": {
"baidu_search": {
"enabled": true,
"api_key": "YOUR_BAIDU_QIANFAN_API_KEY",
"max_results": 10
}
}
}
}

Perplexity

ConfigTypeDefaultDescription
enabledboolfalseEnable Perplexity search
api_keysstring[]--One or more Perplexity API keys for rotation
max_resultsint5Maximum number of results

Tavily

ConfigTypeDefaultDescription
enabledboolfalseEnable Tavily search
api_keysstring[]--One or more Tavily API keys for rotation
base_urlstring--Custom Tavily API base URL
max_resultsint5Maximum number of results

SearXNG

ConfigTypeDefaultDescription
enabledboolfalseEnable SearXNG search
base_urlstringhttp://localhost:8888SearXNG instance URL
max_resultsint5Maximum number of results

GLM (智谱)

ConfigTypeDefaultDescription
enabledboolfalseEnable GLM Search
api_keystring--GLM API key
base_urlstringhttps://open.bigmodel.cn/api/paas/v4/web_searchGLM Search API URL
search_enginestringsearch_stdSearch engine type
max_resultsint5Maximum number of results

Web Proxy

All web tools (search and fetch) can use a shared proxy:

ConfigTypeDefaultDescription
proxystring--Proxy URL for all web tools (http, https, socks5)
fetch_limit_bytesint6410485760Maximum bytes to fetch per URL (default 10MB)

Additional Web Settings

ConfigTypeDefaultDescription
prefer_nativebooltruePrefer provider's native search over configured search engines
private_host_whiteliststring[][]Private/internal hosts allowed for web fetching

web_search Tool Parameters

At runtime, the web_search tool accepts the following parameters:

FieldTypeRequiredDescription
querystringyesSearch query string
countintegernoNumber of results to return. Default: 10, max: 10
rangestringnoOptional time filter: d (day), w (week), m (month), y (year)

If range is omitted, PicoClaw performs an unrestricted search.

Example web_search call:

{
"query": "ai agent news",
"count": 10,
"range": "w"
}

Web Tools Configuration Example

{
"tools": {
"web": {
"brave": {
"enabled": true,
"api_keys": ["YOUR_BRAVE_API_KEY"],
"max_results": 5
},
"duckduckgo": {
"enabled": true,
"max_results": 5
},
"baidu_search": {
"enabled": false,
"api_key": "YOUR_BAIDU_QIANFAN_API_KEY"
},
"perplexity": {
"enabled": false,
"api_keys": ["pplx-xxx"],
"max_results": 5
},
"proxy": "socks5://127.0.0.1:1080"
}
}
}

Exec Tool

The exec tool executes shell commands on behalf of the agent.

ConfigTypeDefaultDescription
enabledbooltrueEnable the exec tool
enable_deny_patternsbooltrueEnable default dangerous command blocking
custom_deny_patternsarray[]Custom deny patterns (regular expressions)
custom_allow_patternsarray[]Custom allow patterns -- matching commands bypass deny checks

Disabling the Exec Tool

To completely disable the exec tool, set enabled to false:

Via config file:

{
"tools": {
"exec": {
"enabled": false
}
}
}

Via environment variable:

PICOCLAW_TOOLS_EXEC_ENABLED=false

Note: When disabled, the agent will not be able to execute shell commands. This also affects the Cron tool's ability to run scheduled shell commands.

Default Blocked Command Patterns

By default, PicoClaw blocks these dangerous commands:

  • Delete commands: rm -rf, del /f/q, rmdir /s
  • Disk operations: format, mkfs, diskpart, dd if=, writing to block devices (/dev/sd*, /dev/nvme*, /dev/mmcblk*, etc.)
  • System operations: shutdown, reboot, poweroff
  • Command substitution: $(), ${}, backticks
  • Pipe to shell: | sh, | bash
  • Privilege escalation: sudo, chmod, chown
  • Process control: pkill, killall, kill -9
  • Remote operations: curl | sh, wget | sh, ssh
  • Package management: apt, yum, dnf, npm install -g, pip install --user
  • Containers: docker run, docker exec
  • Git: git push, git force
  • Other: eval, source *.sh

Custom Allow Patterns

Use custom_allow_patterns to explicitly permit commands that would otherwise be blocked by deny patterns:

{
"tools": {
"exec": {
"enable_deny_patterns": true,
"custom_allow_patterns": ["^git push origin main$"]
}
}
}

Known Architectural Limitation

The exec guard only validates the top-level command sent to PicoClaw. It does not recursively inspect child processes spawned by build tools or scripts after that command starts running.

Examples of workflows that can bypass the direct command guard once the initial command is allowed:

  • make run
  • go run ./cmd/...
  • cargo run
  • npm run build

This means the guard is useful for blocking obviously dangerous direct commands, but it is not a full sandbox for unreviewed build pipelines. If your threat model includes untrusted code in the workspace, use stronger isolation such as containers, VMs, or an approval flow around build-and-run commands.

Exec Configuration Example

{
"tools": {
"exec": {
"enable_deny_patterns": true,
"custom_deny_patterns": ["\\brm\\s+-r\\b", "\\bkillall\\s+python"],
"custom_allow_patterns": []
}
}
}

Cron Tool

The cron tool is used for scheduling periodic tasks.

ConfigTypeDefaultDescription
enabledbooltrueRegister the agent-facing cron tool
allow_commandbooltrueAllow command jobs without extra confirmation
exec_timeout_minutesint5Execution timeout in minutes, 0 means no limit

For schedule types, execution modes (deliver, agent turn, and command jobs), persistence, and the current command-security gates, see Scheduled Tasks and Cron Jobs.

Reaction Tool

The reaction tool adds a reaction (emoji) to a message. It is registered automatically and has no configuration options.

ParameterTypeRequiredDescription
message_idstringNoTarget message ID; defaults to the current inbound message
channelstringNoTarget channel (telegram, whatsapp, etc.)
chat_idstringNoTarget chat/user ID

When all optional parameters are omitted, the tool reacts to the current inbound message on the current channel.

MCP (Model Context Protocol)

PicoClaw supports MCP servers for extending agent capabilities with external tools.

Tool Discovery (Lazy Loading)

When connecting to multiple MCP servers, exposing hundreds of tools simultaneously can exhaust the LLM's context window and increase API costs. The Discovery feature solves this by keeping MCP tools hidden by default.

Instead of loading all tools, the LLM is provided with a lightweight search tool (using BM25 keyword matching or Regex). When the LLM needs a specific capability, it searches the hidden library. Matching tools are then temporarily "unlocked" and injected into the context for a configured number of turns (ttl).

Global Config

ConfigTypeDefaultDescription
enabledboolfalseEnable MCP integration globally
discoveryobject{}Configuration for Tool Discovery (see below)
serversobject{}Map of server name to server config

Discovery Config (discovery)

ConfigTypeDefaultDescription
enabledboolfalseGlobal default: if true, all MCP tools are hidden and loaded on-demand via search; if false, all tools are loaded into context. Individual servers can override this with the per-server deferred field.
ttlint5Number of conversational turns a discovered tool remains unlocked
max_search_resultsint5Maximum number of tools returned per search query
use_bm25booltrueEnable the natural language/keyword search tool (tool_search_tool_bm25). Warning: consumes more resources than regex search
use_regexboolfalseEnable the regex pattern search tool (tool_search_tool_regex)

Note: If discovery.enabled is true, you MUST enable at least one search engine (use_bm25 or use_regex), otherwise the application will fail to start.

Per-Server Config

ConfigTypeRequiredDescription
enabledboolyesEnable this MCP server
deferredboolnoOverride deferred mode for this server only. true = tools are hidden and discoverable via search; false = tools are always visible in context. When omitted, the global discovery.enabled value applies.
typestringnoTransport type: stdio, sse, http
commandstringstdioExecutable command for stdio transport
argsarraynoCommand arguments for stdio transport
envobjectnoEnvironment variables for stdio process
env_filestringnoPath to environment file for stdio process
urlstringsse/httpEndpoint URL for sse/http transport
headersobjectnoHTTP headers for sse/http transport

Transport Behavior

  • If type is omitted, transport is auto-detected:
    • url is set -> sse
    • command is set -> stdio
  • http and sse both use url + optional headers.
  • env and env_file are only applied to stdio servers.

MCP tools are registered with the naming convention mcp_<server>_<tool> and appear alongside built-in tools.

MCP Configuration Examples

1) Stdio MCP server

{
"tools": {
"mcp": {
"enabled": true,
"servers": {
"filesystem": {
"enabled": true,
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/tmp"
]
}
}
}
}
}

2) Remote SSE/HTTP MCP server

{
"tools": {
"mcp": {
"enabled": true,
"servers": {
"remote-mcp": {
"enabled": true,
"type": "sse",
"url": "https://example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
}
}

3) Massive MCP setup with Tool Discovery enabled

In this example, the LLM will only see the tool_search_tool_bm25. It will search and unlock Github or Postgres tools dynamically only when requested by the user.

{
"tools": {
"mcp": {
"enabled": true,
"discovery": {
"enabled": true,
"ttl": 5,
"max_search_results": 5,
"use_bm25": true,
"use_regex": false
},
"servers": {
"github": {
"enabled": true,
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN"
}
},
"postgres": {
"enabled": true,
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:password@localhost/dbname"
]
},
"slack": {
"enabled": true,
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "YOUR_SLACK_BOT_TOKEN",
"SLACK_TEAM_ID": "YOUR_SLACK_TEAM_ID"
}
}
}
}
}
}

4) Mixed setup: per-server deferred override

Discovery is enabled globally, but filesystem is pinned as always-visible while context7 follows the global default (deferred). aws explicitly opts in to deferred mode even though it is the same as the global default.

{
"tools": {
"mcp": {
"enabled": true,
"discovery": {
"enabled": true,
"ttl": 5,
"max_search_results": 5,
"use_bm25": true
},
"servers": {
"filesystem": {
"enabled": true,
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"],
"deferred": false
},
"context7": {
"enabled": true,
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"aws": {
"enabled": true,
"command": "npx",
"args": ["-y", "aws-mcp-server"],
"deferred": true
}
}
}
}
}

Tip: deferred on a per-server basis is independent of discovery.enabled. You can keep discovery.enabled: false globally (all tools visible by default) and still mark individual high-volume servers as "deferred": true to avoid polluting the context with their tools.

File Tools

Read File

The read_file tool reads files from the workspace. It supports two modes:

ConfigTypeDefaultDescription
enabledbooltrueEnable the read_file tool
modestring"bytes"Read mode: "bytes" (offset/length slicing) or "lines" (line-number-based slicing)
max_read_file_sizeint0Max file size in bytes the tool will read (0 = default limit)
{
"tools": {
"read_file": {
"enabled": true,
"mode": "bytes"
}
}
}

In "bytes" mode the agent specifies byte offsets; in "lines" mode it specifies line numbers. Choose "lines" when working with source code that the agent frequently navigates by line reference.

Load Image

The load_image tool loads a local image file into the agent's context so vision-capable models can analyze it. Supported formats: JPEG, PNG, GIF, WebP, BMP.

ConfigTypeDefaultDescription
enabledbooltrueEnable the load_image tool
{
"tools": {
"load_image": {
"enabled": true
}
}
}

The tool returns a media:// reference that the agent loop resolves to a base64-encoded image in the next LLM request. This is distinct from send_file (which sends the file to the user); load_image makes the image visible to the LLM.

Send TTS

The send_tts tool converts text to speech and sends the audio to the current chat. It requires a TTS model configured under voice.tts_model_name.

ConfigTypeDefaultDescription
enabledboolfalseEnable the send_tts tool
{
"tools": {
"send_tts": {
"enabled": true
}
}
}

Skills Tool

The skills tool manages skill discovery and installation via registries like ClawHub.

Registries

ConfigTypeDefaultDescription
registries.clawhub.enabledbooltrueEnable ClawHub registry
registries.clawhub.base_urlstringhttps://clawhub.aiClawHub base URL
registries.clawhub.auth_tokenstring""Optional Bearer token for higher rate limits
registries.clawhub.search_pathstring""Search API path
registries.clawhub.skills_pathstring""Skills API path
registries.clawhub.download_pathstring""Download API path
registries.clawhub.timeoutint0Request timeout in seconds (0 = default)
registries.clawhub.max_zip_sizeint0Max skill zip size in bytes (0 = default)
registries.clawhub.max_response_sizeint0Max API response size in bytes (0 = default)

GitHub Integration

ConfigTypeDefaultDescription
github.proxystring""HTTP proxy for GitHub API requests
github.tokenstring""GitHub personal access token

Search Settings

ConfigTypeDefaultDescription
max_concurrent_searchesint2Max concurrent skill search requests
search_cache.max_sizeint50Max cached search results
search_cache.ttl_secondsint300Cache TTL in seconds

Skills Configuration Example

{
"tools": {
"skills": {
"registries": {
"clawhub": {
"enabled": true,
"base_url": "https://clawhub.ai",
"auth_token": ""
}
},
"github": {
"proxy": "",
"token": ""
},
"max_concurrent_searches": 2,
"search_cache": {
"max_size": 50,
"ttl_seconds": 300
}
}
}
}

Environment Variables

All configuration options can be overridden via environment variables with the format PICOCLAW_TOOLS_<SECTION>_<KEY>:

  • PICOCLAW_TOOLS_WEB_BRAVE_ENABLED=true
  • PICOCLAW_TOOLS_EXEC_ENABLED=false
  • PICOCLAW_TOOLS_EXEC_ENABLE_DENY_PATTERNS=false
  • PICOCLAW_TOOLS_CRON_EXEC_TIMEOUT_MINUTES=10
  • PICOCLAW_TOOLS_MCP_ENABLED=true

Note: Nested map-style config (for example tools.mcp.servers.<name>.*) is configured in config.json rather than environment variables.