Skip to main content
The Web Search Tool (web_search) is a mAItion Workspace Tool. It gives the LLM one on-demand function — searching the live web — backed by the Tavily search API.

What It Does

web_search(query) takes a single required search string and returns a formatted block: each result’s title, URL, and a content snippet, plus (when available and enabled) Tavily’s own synthesized answer to the query. For each result that has a URL, the tool emits a source citation event so it appears as a clickable reference under the response.

Valves

Every numeric valve above has real schema validation — an out-of-range value is rejected, not silently clamped. Tool id: web_search. Display name: “Web Search”. Valves can be edited after install from Workspace → Tools in mAItion.

Enabling via ENV

This tool is opt-in, with a single-condition gate. Set in .env:
  • TOOL_WEB_SEARCH_ENABLED=True is the only required condition to install.
  • TOOL_WEB_SEARCH_API_KEY is optional for install, but set it at the same time as TOOL_WEB_SEARCH_ENABLED in practice — without it, the tool installs but can’t run any search until you set the tavily_api_key valve manually afterward. If left unset, the tool still installs, with tavily_api_key at its empty default, and the entrypoint script logs a note pointing to Workspace → Tools for manual configuration. Nothing fails and nothing is skipped.
  • Only tavily_api_key is ever set from ENV. The other six valves (max_results, search_depth, include_answer, topic, timeout, max_content_chars) are configured only through the UI, or left at their defaults above.
This installs only during first-start initialization — the setup that runs only once, the first time the container boots, gated on a marker file. Setting the ENV flag on an already-running instance does not install it retroactively. Set the flag before the container’s first boot, or add the tool manually afterward from the admin UI.

Troubleshooting