Tools Invoke (HTTP)
OpenClaw’s Gateway exposes a simple HTTP endpoint for invoking a single tool directly. It is always enabled, but gated by Gateway auth and tool policy.POST /tools/invoke- Gateway के समान पोर्ट (WS + HTTP मल्टीप्लेक्स):
http://<gateway-host>:<port>/tools/invoke
प्रमाणीकरण
Uses the Gateway auth configuration. Send a bearer token:Authorization: Bearer <token>
- जब
gateway.auth.mode="token", तबgateway.auth.token(याOPENCLAW_GATEWAY_TOKEN) का उपयोग करें। - जब
gateway.auth.mode="password", तबgateway.auth.password(याOPENCLAW_GATEWAY_PASSWORD) का उपयोग करें। - यदि
gateway.auth.rateLimitकॉन्फ़िगर है और बहुत अधिक auth विफलताएँ होती हैं, तो endpointRetry-Afterके साथ429लौटाता है।
Request body
tool(string, आवश्यक): इनवोक किए जाने वाले टूल का नाम।action(string, वैकल्पिक): यदि टूल स्कीमाactionका समर्थन करता है और args पेलोड में इसे छोड़ा गया है, तो इसे args में मैप किया जाता है।args(object, वैकल्पिक): टूल-विशिष्ट आर्ग्युमेंट्स।sessionKey(string, optional): target session key. If omitted or"main", the Gateway uses the configured main session key (honorssession.mainKeyand default agent, orglobalin global scope).dryRun(boolean, वैकल्पिक): भविष्य के उपयोग के लिए आरक्षित; वर्तमान में अनदेखा किया जाता है।
Policy + routing behavior
टूल की उपलब्धता Gateway एजेंट्स द्वारा उपयोग की जाने वाली उसी नीति शृंखला के माध्यम से फ़िल्टर की जाती है:tools.profile/tools.byProvider.profiletools.allow/tools.byProvider.allowagents.<id>.tools.allow/agents.<id>.tools.byProvider.allow- समूह नीतियाँ (यदि सत्र कुंजी किसी समूह या चैनल से मैप होती है)
- उप-एजेंट नीति (जब उप-एजेंट सत्र कुंजी के साथ इनवोक किया जाता है)
x-openclaw-message-channel: <channel>(उदाहरण:slack,telegram)x-openclaw-account-id: <accountId>(जब कई खाते मौजूद हों)gatewaywhatsapp_login
gateway.tools के माध्यम से अनुकूलित कर सकते हैं:
x-openclaw-message-channel: <channel>(उदाहरण:slack,telegram)x-openclaw-account-id: <accountId>(जब कई खाते मौजूद हों)
Responses
200→{ ok: true, result }400→{ ok: false, error: { type, message } }(अमान्य अनुरोध या टूल इनपुट त्रुटि)401→ अनधिकृत429→ auth rate-limited (Retry-Afterसेट)404→ टूल उपलब्ध नहीं (नहीं मिला या allowlist में नहीं)405→ विधि अनुमत नहीं500→{ ok: false, error: { type, message } }(अनपेक्षित टूल निष्पादन त्रुटि; सुरक्षित किया गया संदेश)