OpenClawSkills
GitHub
Gateway / 运用 • TutorialHeader.readTime

工具调用 HTTP API

ReferenceGatewayToolsInvokeHttpApiPage.header.description

ReferenceGatewayToolsInvokeHttpApiPage.intro.p1

- POST /tools/invoke

- ReferenceGatewayToolsInvokeHttpApiPage.intro.port

ReferenceGatewayToolsInvokeHttpApiPage.intro.p2

Tutorial.step

认证

ReferenceGatewayToolsInvokeHttpApiPage.steps.auth.p1

- Authorization: Bearer <token>

注意:

- ReferenceGatewayToolsInvokeHttpApiPage.steps.auth.notes.tokenMode

- ReferenceGatewayToolsInvokeHttpApiPage.steps.auth.notes.passwordMode

Tutorial.step

ReferenceGatewayToolsInvokeHttpApiPage.steps.requestBody.title

Json
{
  "tool": "sessions_list",
  "action": "json",
  "args": {},
  "sessionKey": "main",
  "dryRun": false
}

字段:

- ReferenceGatewayToolsInvokeHttpApiPage.steps.requestBody.fields.tool

- ReferenceGatewayToolsInvokeHttpApiPage.steps.requestBody.fields.action

- ReferenceGatewayToolsInvokeHttpApiPage.steps.requestBody.fields.args

- ReferenceGatewayToolsInvokeHttpApiPage.steps.requestBody.fields.sessionKey

- ReferenceGatewayToolsInvokeHttpApiPage.steps.requestBody.fields.dryRun

Tutorial.step

ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.title

ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.p1

- tools.profile / tools.byProvider.profile

- tools.allow / tools.byProvider.allow

- agents.<id>.tools.allow / agents.<id>.tools.byProvider.allow

- ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.items.groupPolicy

- ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.items.subAgentPolicy

ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.p2

ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.p3

- x-openclaw-message-channel: <channel>(例:slack、telegram)

- ReferenceGatewayToolsInvokeHttpApiPage.steps.policy.headers.accountId

Tutorial.step

ReferenceGatewayToolsInvokeHttpApiPage.steps.responses.title

- <code>200</code> → <code>'{ ok: true, result }'</code>

- ReferenceGatewayToolsInvokeHttpApiPage.steps.responses.items.400

- 401 → Unauthorized

- ReferenceGatewayToolsInvokeHttpApiPage.steps.responses.items.404

- 405 → Method not allowed

Tutorial.step

例

Bash
curl -sS http://127.0.0.1:18789/tools/invoke   -H 'Authorization: Bearer YOUR_TOKEN'   -H 'Content-Type: application/json'   -d '{
    "tool": "sessions_list",
    "action": "json",
    "args": {}
  }'