tools.toolSearch पर निर्भर नहीं करतीं।
OpenClaw रन के लिए सक्षम होने पर, मॉडल को डिफ़ॉल्ट रूप से एक tool_search_code टूल
मिलता है। वह टूल एक isolated Node
सबप्रोसेस में openclaw.tools bridge के साथ एक छोटा JavaScript body चलाता है:
एक turn कैसे चलता है
planning time पर OpenClaw embedded runner रन के लिए effective catalog बनाता है:- एजेंट, profile, sandbox, और session के लिए active tool policy resolve करें।
- eligible OpenClaw और Plugin टूल सूचीबद्ध करें।
- session MCP runtime के माध्यम से eligible MCP टूल सूचीबद्ध करें।
- current run के लिए दिए गए eligible client टूल जोड़ें।
- search के लिए compact descriptors index करें।
- OpenClaw code bridge, structured fallback tools, या compact directory surface को मॉडल के सामने expose करें।
openclaw.tools.call(...) bridge पार करके वापस Gateway में जाता है, जहाँ
normal policy, approval, hook, logging, और result handling अभी भी लागू होते हैं।
मोड
tools.toolSearch में तीन model-facing मोड हैं:
code:tool_search_codeexpose करता है, default compact JavaScript bridge।tools: code न पाने वाले providers के लिएtool_search,tool_describe, औरtool_callको plain structured tools के रूप में expose करता है।directory:tool_search,tool_describe, औरtool_callके साथ उपलब्ध tool names और descriptions की bounded prompt directory expose करता है उन providers के लिए जिन्हें हर full schema के बिना tool names दिखने चाहिए। OpenClaw current turn के लिए likely या required tool schemas का एक छोटा bounded set भी सीधे expose कर सकता है।
code mode catalog
compaction से पहले tools पर fallback करता है। directory mode में, client-provided tools current run के लिए सीधे visible रहते हैं जबकि OpenClaw tools, Plugin tools, और MCP tools को
directory catalog के पीछे compact किया जा सकता है। किसी exact hidden
directory name पर direct call को execution से पहले उसी authorized catalog से hydrate किया जाता है।
सभी मोड experimental हैं। छोटे OpenClaw tool
catalogs के लिए direct tool exposure को प्राथमिकता दें, और Codex harness runs के लिए Codex-native stable surfaces को प्राथमिकता दें।
कोई अलग source-selection config नहीं है। जब टूल खोज सक्षम होता है, तो
catalog में normal policy filtering के बाद eligible OpenClaw, MCP, और client tools शामिल होते हैं।
यह क्यों मौजूद है
बड़े catalogs उपयोगी लेकिन महंगे होते हैं। हर tool schema को मॉडल को भेजने से request बड़ा हो जाता है, planning धीमी होती है, और accidental tool selection बढ़ती है। टूल खोज shape बदलता है:- direct tools: मॉडल first token से पहले हर selected schema देखता है
- टूल खोज code mode: मॉडल एक compact code tool और एक छोटा API contract देखता है
- टूल खोज tools mode: मॉडल तीन compact structured fallback tools देखता है
- टूल खोज directory mode: मॉडल bounded directory plus search/describe/call controls और likely या required schemas का एक छोटा bounded set देखता है
- turn के दौरान: मॉडल remaining schemas को आवश्यकता अनुसार load कर सकता है
API
openclaw.tools.search(query, options?)
current run के लिए effective catalog खोजता है। Results compact और safe हैं
prompt context में वापस रखने के लिए।
openclaw.tools.describe(id)
एक search result के लिए full metadata load करता है, जिसमें exact input schema शामिल है।
openclaw.tools.call(id, args)
OpenClaw के माध्यम से selected tool कॉल करता है।
tool_searchtool_describetool_call
tool_searchtool_describetool_call
tool_search उपयोग करें। यदि
मॉडल किसी exact hidden directory tool name को सीधे request करता है, तो OpenClaw
normal execution से पहले उसे authorized catalog से hydrate करता है।
Directory-mode client tool names को OpenClaw, Plugin, या MCP
tool names से collide नहीं करना चाहिए क्योंकि exact deferred dispatch उन्हीं names का उपयोग करता है।
Runtime boundary
code bridge एक short-lived Node subprocess में चलता है। subprocess Node permission mode enabled, empty environment, filesystem या network grants के बिना, और child-process या worker grants के बिना start होता है। OpenClaw parent-process wall-clock timeout enforce करता है और timeout पर subprocess को kill करता है, जिसमें async continuations के बाद भी शामिल है। runtime केवल expose करता है:console.log,console.warn, औरconsole.erroropenclaw.tools.searchopenclaw.tools.describeopenclaw.tools.call
- tool allow और deny policies
- per-agent और per-sandbox tool restrictions
- channel/runtime tool policy
- approval hooks
- Plugin
before_tool_callhooks - session identity, logs, और telemetry
Config
default code bridge के साथ OpenClaw runs के लिए टूल खोज सक्षम करें:Prompt और telemetry
टूल खोज direct tool exposure से तुलना करने के लिए पर्याप्त telemetry record करता है:- harness को भेजे गए total serialized tool और prompt bytes
- catalog size और source breakdown
- search, describe, और call counts
- OpenClaw के माध्यम से executed final tool calls
- selected tool ids और sources
- मॉडल ने शुरुआत में कितने tool schemas देखे
- उसने कितने search और describe operations perform किए
- कौन सा final tool call किया गया
- result OpenClaw, MCP, या client tool से आया या नहीं
E2E validation
gateway E2E runner OpenClaw runtime के साथ दोनों paths prove करता है:- Direct mode fake Plugin tool को call कर सकता है।
- टूल खोज उसी fake Plugin tool को call कर सकता है।
- Direct mode fake Plugin tool schemas को provider के सामने directly expose करता है।
- टूल खोज केवल compact bridge expose करता है।
- large fake catalog के लिए Tool Search request payload छोटा है।
- Session logs expected tool-call counts और bridged call telemetry दिखाते हैं।
Failure behavior
टूल खोज को fail closed होना चाहिए:- यदि कोई tool effective policy में नहीं है, तो search को उसे return नहीं करना चाहिए
- यदि selected tool unavailable हो जाता है, तो
tool_callfail होना चाहिए - यदि policy या approval execution block करता है, तो call result को उसे bypass करने के बजाय उस block को report करना चाहिए
- यदि code bridge isolated runtime create नहीं कर सकता, तो
mode: "tools"उपयोग करें या उस deployment के लिए टूल खोज disable करें