LLM Task Tool: JSON-only LLM Calls for Workflows
This page covers the optional llm-task plugin tool that executes a single LLM call limited to JSON, producing structured output optionally validated against a JSON Schema. It is intended for workflow engine users who need to incorporate an LLM step without custom code.
Read this when
- You want a JSON-only LLM step inside workflows
- You need schema-validated LLM output for automation
llm-task ships as an optional plugin tool that executes a single LLM call limited to JSON, producing structured output that can optionally be validated against a JSON Schema. This lets workflow engines such as Lobster incorporate an LLM step without requiring custom OpenClaw code for each workflow.
Enable
- Activate the plugin:
{
"plugins": {
"entries": {
"llm-task": { "enabled": true }
}
}
}
- Grant access to the tool:
{
"tools": {
"alsoAllow": ["llm-task"]
}
}
alsoAllow extends the active tool profile with llm-task without blocking any other core tools. Only reach for tools.allow when you need a strict allowlist approach.
Config (optional)
{
"plugins": {
"entries": {
"llm-task": {
"enabled": true,
"config": {
"defaultProvider": "openai",
"defaultModel": "gpt-5.6-sol",
"defaultAuthProfileId": "main",
"allowedModels": ["openai/gpt-5.6-sol"],
"maxTokens": 800,
"timeoutMs": 30000
}
}
}
}
}
allowedModels defines which provider/model strings are permitted; any request for a model outside this list gets rejected. Every remaining key acts as a per-call fallback, applied when the tool call leaves that parameter unspecified.
Tool parameters
| Parameter | Type | Notes |
|---|---|---|
prompt | string | Required. Describes the job the LLM should perform. |
input | any | Optional data payload; serialized into JSON and appended to the prompt. |
schema | object | Optional JSON Schema that the parsed output must conform to. |
provider | string | Replaces defaultProvider or the agent's default provider. |
model | string | Replaces defaultModel; accepts plain model IDs, aliases, or a provider/model reference (a duplicate provider prefix gets removed automatically). |
thinking | string | Reasoning level (for instance low, medium); the resolved model must support the chosen level. |
authProfileId | string | Replaces defaultAuthProfileId. |
temperature | number | Best-effort; not every provider respects it. |
maxTokens | number | Best-effort cap on output tokens. |
timeoutMs | number | Run timeout; defaults to 30000. |
Output
Produces details.json (the parsed JSON that passed schema validation) together with details.provider and details.model, which identify the model and provider that actually executed.
Example: Lobster workflow step
Important limitation
The following example assumes the standalone Lobster CLI is active and that openclaw.invoke already holds the correct gateway URL and authentication context.
For the embedded Lobster runner bundled inside OpenClaw, this nested CLI pattern is not currently reliable:
openclaw.invoke --tool llm-task --action json --args-json '{ ... }'
Until embedded Lobster exposes a supported bridge for this flow, choose either:
- direct
llm-tasktool calls outside Lobster, or - Lobster steps that avoid nested
openclaw.invokecalls.
Standalone Lobster CLI example:
openclaw.invoke --tool llm-task --action json --args-json '{
"prompt": "Given the input email, return intent and draft.",
"thinking": "low",
"input": {
"subject": "Hello",
"body": "Can you help?"
},
"schema": {
"type": "object",
"properties": {
"intent": { "type": "string" },
"draft": { "type": "string" }
},
"required": ["intent", "draft"],
"additionalProperties": false
}
}'
Safety notes
- JSON-only: the model is instructed to return a plain JSON value, with no code fences or extra text.
- No tools: the underlying run has tools turned off, so the model cannot invoke anything mid-task.
- Treat output as untrusted unless you validate it with
schema. - Place approvals before any side-effecting step (send, post, exec) that uses this output.