Auto-Built AI Tools
Last updated
Agenvoy supports three ways to add tools beyond the built-in set: auto-generation from a capability gap, script tools, and MCP tools. User-defined API tools were Removed in v1.3.2 (see Script and MCP Tools). Tools installed by an extension land under ~/.config/agenvoy/tools/.extension/ and register with the
ext_ prefix; since v1.3.2 they come only from scripts. The built-in extension-install and extension-upload skills were Removed in v1.5.0 pending an extension-store redesign; until then, put an extension's script tool under ~/.config/agenvoy/tools/.extension/script/<name>/ yourself.Auto-generation (Capability Gap)
When a user request needs live external data (weather, currency, stock, geocoding, translation, etc.) and no existing tool covers it, the agent looks up a keyless public API and calls it directly, and creates a script tool on the spot only when no listed API fits, then runs it to answer. No programming required. Since v1.3.1, with a decision model set, each turn first asks it whether the request needs a capability no available tool name covers — general tools such as
http_request, run_command, fetch_page or search_web do not count for recurring live data; when it answers missing with confidence 0.7 or higher, the turn context carries a Tool gap line telling the agent to call reasoning_guide(topics=["tool_generate"]) before any other tool. The check is skipped when reasoning_guide or write_tool is excluded.reasoning_guide(topics=[tool_generate]) carries the build contract (since v1.0.26 the tool takes a topics array, so several guides load in one call; it took a single topic before); the same text is exposed to external agents through the MCP server as tool_generate_guide. The sequence:| Step | Action |
|---|---|
| 1. Find an API | public_api_list() for the category names → pick up to 3 relevant categories → public_api_list(category) for each; every listed API is keyless, prefer HTTPS |
| 2. A fitting API exists | fetch_page the candidate's docs URL for base URL, endpoint, parameters and response shape → http_request (as many calls as the answer needs) → answer. No tool is built; the same flow repeats next time |
| 3. Build a script tool | Only outside the public list: a user-supplied API that needs a key (get_key() inside the sandbox keeps it out of the conversation, which http_request headers do not), or an answer Python (stdlib, a public data file, a library) can produce. write_tool(mode=write) with tag=json + tag=script (renamed from edit_tool, Removed in v1.5.0) |
| 4. Verify | Since v1.6.0 validate_tool checks tool.json and the script's presence first, and every issue it lists is patched with write_tool(mode=patch) until it returns valid; then test_tool runs script.py in the sandbox, and failures are fixed with write_tool(mode=patch) and re-tested (at most 3 retries) |
| 5. Answer | Call the new tool and answer from its output; with no API and no Python route, fall back to search_web / fetch_page and say where the data came from |
Before v1.3.2 step 1 called the API tool
api_public_api_list(type=category) and step 2 could pick a declarative API tool (tag=api) for a single REST endpoint; both were Removed in v1.3.2.After creation, the tool persists under
~/.config/agenvoy/tools/script/<name>/ and is available in all future sessions and to every connected MCP agent. Credentials are never hardcoded: the naming convention is {BRAND}_API_KEY, captured with store_secret. The local key lookup endpoint GET /v1/key?key=<KEY_NAME> was removed in v1.0.23: a script tool now reads the key itself (the guide's get_key() helper) in the order OS keychain (service agenvoy) → ~/.config/agenvoy/.secrets on Linux → the environment variable of the same name.Key constraints:
- Since v1.3.2 a keyless public API is answered with
http_requestdirectly and no tool is saved; the former rule that every data request must be answered by a reusable tool on disk was Removed in v1.3.2. A tool is written only on the script-tool path (step 3). One-off verification or debugging (probing an endpoint, a parameter or a flag) runs inline throughrun_commandand saves no tool fetch_pagereads the API documentation; it fetches answer data only in the fallback where no API and no Python route exist, together withsearch_web, naming the source- Names are
snake_caseverb + noun (fetch_weather,calculate_rsi) with no prefix — the runtime addsscript_