openclaw/extensions/llm-task
2026-01-24 01:11:16 +00:00
..
src feat(llm-task): add optional JSON-only LLM task tool 2026-01-24 01:11:16 +00:00
clawdbot.plugin.json feat(llm-task): add optional JSON-only LLM task tool 2026-01-24 01:11:16 +00:00
index.ts feat(llm-task): add optional JSON-only LLM task tool 2026-01-24 01:11:16 +00:00
package.json fix(llm-task): fix invalid package.json 2026-01-24 01:11:16 +00:00
README.md feat(llm-task): add optional JSON-only LLM task tool 2026-01-24 01:11:16 +00:00

LLM Task (plugin)

Adds an optional agent tool llm-task for running JSON-only LLM tasks (drafting, summarizing, classifying) with optional JSON Schema validation.

This is designed to be called from workflow engines (e.g. Lobster via clawd.invoke --each) without adding new Clawdbot code per workflow.

Enable

  1. Enable the plugin:
{
  "plugins": {
    "entries": {
      "llm-task": { "enabled": true }
    }
  }
}
  1. Allowlist the tool (it is registered with optional: true):
{
  "agents": {
    "list": [
      {
        "id": "main",
        "tools": { "allow": ["llm-task"] }
      }
    ]
  }
}

Config (optional)

{
  "plugins": {
    "entries": {
      "llm-task": {
        "enabled": true,
        "config": {
          "defaultProvider": "openai-codex",
          "defaultModel": "gpt-5.2",
          "allowedModels": ["openai-codex/gpt-5.2"],
          "maxTokens": 800,
          "timeoutMs": 30000
        }
      }
    }
  }
}

allowedModels is an allowlist of provider/model strings. If set, any request outside the list is rejected.

Tool API

Parameters

  • prompt (string, required)
  • input (any, optional)
  • schema (object, optional JSON Schema)
  • provider (string, optional)
  • model (string, optional)
  • authProfileId (string, optional)
  • temperature (number, optional)
  • maxTokens (number, optional)
  • timeoutMs (number, optional)

Output

Returns details.json containing the parsed JSON (and validates against schema when provided).

Notes

  • The tool is JSON-only and instructs the model to output only JSON (no code fences, no commentary).
  • Side effects should be handled outside this tool (e.g. approvals in Lobster) before calling tools that send messages/emails.