#Tool call issue

1 messages Β· Page 1 of 1 (latest)

pliant hornet
#

I managed to get OpenClaw installed through WSL and using Ubuntu. Took way longer than you would think lol. Lots of hiccups. But anyway, I am running Ollama/Gemma4 in a sandbox. Yay!

Problem though. Even though I gave my Ai the API keys it needs (still free accounts, if that matters) it seems to struggle with actually calling on those programs and creating the media in a timely manner. In fact, it seems to not be able to. It says that it is working on it, but I don't believe it. It just takes forever, and I've yet to receive a finished product from it.

Can someone help me diagnose wth is going on? I've been asking other AI's for help, but I think there is only so much that they can explain how to do without seeing my screen, which is unfortunately not an option. Unless... πŸ‘€ but idk

fiery oceanBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

frozen lakeBOT
#

Nice, getting WSL + Ubuntu + Ollama standing up is already a win 🦞

A few likely culprits here:

  1. Local Ollama/Gemma can be bad at tool calling. It may say β€œI’m working on it” while failing to emit a real structured tool call. That’s model/tool-call compatibility, not you being impatient.
  2. Media generation is separate from the chat model. Gemma/Ollama can chat, but image/video generation needs an image_generate / video_generate provider configured separately, with working billing/quota/auth for that provider.
  3. Free API accounts often hit quota/rate limits, and some media providers are slow/asynchronous, especially video.
  4. If your Ollama config points at http://...:11434/v1, that can break tool calling. OpenClaw docs say to use native Ollama: http://127.0.0.1:11434 with api: "ollama", no /v1.

Can you paste these outputs? They should redact secrets:

openclaw --version
openclaw status --all
openclaw models status
openclaw models list --provider ollama
#

And for a focused smoke test:

curl http://127.0.0.1:11434/api/tags
openclaw infer model run --model ollama/gemma4 --prompt "Reply with exactly: ok" --json
/tool image_generate action=list

If the direct infer model run works but normal chat/tool tasks hang, I’d try one of these next:

openclaw config set agents.defaults.experimental.localModelLean true

or temporarily switch the session to a stronger hosted model for tool-heavy/media tasks, while keeping Ollama for basic chat.

Docs that match this exact area:

pliant hornet
#

OpenClaw status --all
Overview
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Item β”‚ Value β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Version β”‚ 2026.5.7 β”‚
β”‚ OS β”‚ linux 6.6.114.1-microsoft-standard-WSL2 (x64) β”‚
β”‚ Node β”‚ 22.22.2
β”‚ Config β”‚ ~/.openclaw/openclaw.json
β”‚ Dashboard β”‚ http://127.0.0.1:18789/
β”‚ Tailscale exposure β”‚ off
β”‚ Channel β”‚ stable (default)
β”‚ Update β”‚ pnpm Β· up to date Β· npm latest 2026.5.7
β”‚ Gateway β”‚ local Β· ws://127.0.0.1:18789 (local loopback) Β· reachable 76ms Β· auth token β”‚
β”‚ Security β”‚ Run: openclaw security audit --deep
β”‚ Gateway self β”‚ unknown
β”‚ Gateway service β”‚ systemd user installed Β· enabled Β· running (pid 1137, state active) β”‚
β”‚ Node service β”‚ systemd user not installed
β”‚ Agents β”‚ 1 total Β· 1 bootstrapping Β· 1 active Β· 1 sessions
β”‚ Secrets β”‚ none

frozen lakeBOT
#

That status output already shows two big clues:

  1. Secrets: none β€” OpenClaw currently doesn’t see any configured API keys/secrets. So if the agent is supposed to call image/video/search/etc providers, it likely has no usable credentials from the Gateway’s point of view.

  2. Agents: 1 total Β· 1 bootstrapping β€” your agent may still be stuck in first-run/bootstrap mode instead of normal operation. That can make it feel like it’s β€œworking” forever.

Next checks I’d run:

openclaw models status
openclaw models list --provider ollama
openclaw logs --tail 120

For the secrets/API key side, run:

#
openclaw auth list
openclaw models status

If you added keys in .env, remember: because this is running as a systemd user service, it may not inherit the same shell environment where you typed export OPENAI_API_KEY=.... Prefer configuring through OpenClaw onboarding/configure, or restart the gateway after changing env/config:

openclaw configure
openclaw gateway restart

Also: for Ollama, please verify your config does not use /v1:

openclaw config get models.providers.ollama
#

Good base URL shape is:

baseUrl: "http://127.0.0.1:11434"
api: "ollama"

Not:

http://127.0.0.1:11434/v1

Paste models status, auth list, and the last ~120 log lines if you can. Don’t paste raw API keys; OpenClaw usually redacts, but still eyeball it first.

pliant hornet
#

Can you try helping me by speaking to me like I am computer-illiterate? I'm having trouble understanding your corrections and instructions

frozen lakeBOT
#

Yes β€” absolutely. Sorry, I went too β€œtech support manual” there.

Here’s the simple version:

Your OpenClaw is running, but it looks like two things may be wrong:

1. OpenClaw may not actually see your API keys.
Even if you typed the keys somewhere, OpenClaw’s background service may not know about them yet. So your AI says β€œI’m making the image/video,” but the tool it needs may not actually be usable.

2. Your local Ollama/Gemma model may not be good at using tools.
Some local models can chat fine, but when asked to β€œuse a tool” β€” like image generation, browser, web search, etc. β€” they kind of pretend instead of actually doing it.

Let’s do this one tiny step at a time.

Please run this command first and paste the result:

#
openclaw models status

That command is just a health check. It should tell us whether OpenClaw can see any working AI providers.

After that, we’ll do the next command. One at a time β€” no firehose 🦞

pliant hornet
#

🦞 OpenClaw 2026.5.7 (eeef486) β€” Your second brain, except this one actually remembers where you left things.

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : ollama/gemma4
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (1) : OpenRouter -> openrouter/auto
Configured models (2): openrouter/auto, ollama/gemma4

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -

  • ollama effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | ollama:default=marker(ollama-local) | models.json=OL...EY | source=models.json: ~/.openclaw/agents/main/agent/models.json
  • openrouter effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | openrouter:default=sk...7e

OAuth/token status

  • none
frozen lakeBOT
#

Perfect, thank you. This tells us a lot.

Plain-English diagnosis:

Your chat brain is set up: ollama/gemma4

Your backup chat brain is set up: openrouter/auto

But your image-making brain is missing: Image model: -

So if you ask it to make images/media, OpenClaw does not currently have a specific image generation model configured. That may be why it talks like it is doing the job, but nothing actually arrives.

Next tiny step:

Please run this:

#
/tool image_generate action=list

That asks OpenClaw: β€œWhat image-making tools are actually available?”

Paste what it says. After that I can tell you exactly whether this is:

  • no image provider configured
  • API key/quota problem
  • local Gemma tool-calling problem
  • or wrong model for the job

Also: your Ollama/Gemma setup is probably okay for chatting. The issue is more likely that media generation is a separate setup step.

pliant hornet
#

-bash: /tool: No such file or directory

frozen lakeBOT
#

Ah! My fault β€” that command goes inside OpenClaw chat, not inside Ubuntu/bash.

Think of it like this:

  • Commands that start with openclaw ... go in your Ubuntu terminal.
  • Commands that start with /... go in the chat where you talk to your OpenClaw agent.

So don’t worry, you didn’t break anything.

Since we already know your image model says Image model: -, let’s skip that slash command for now.

The easy next step is: open your Ubuntu terminal and run this:

openclaw configure
#

Then look for something like image generation, media, or provider setup. If it asks which provider to use, the one you already have a key for is probably easiest. You currently have OpenRouter configured, so if it offers OpenRouter image generation, choose that.

If you want a direct command instead of clicking through menus, try this:

openclaw config set agents.defaults.imageGenerationModel.primary "openrouter/google/gemini-3.1-flash-image-preview"
openclaw gateway restart

Then ask your OpenClaw agent something simple like:

Generate a small image of a cute lobster mascot.

Important note: your Gemma/Ollama model is the β€œtalking brain.” The image model is a separate β€œdrawing machine.” Right now the drawing machine is not selected, so the talking brain is probably just saying words about making images instead of actually making them.

pliant hornet
#

I ran that direct command you gave me. Question: How do I go from typing into the ubuntu terminal to typing directly with the chat bot? Is there a command I have to give to wake it up?

frozen lakeBOT
#

Totally fair question.

You have two easy ways to β€œtalk to the bot”:

Option A β€” chat in the terminal
In Ubuntu, type:

openclaw chat

That opens a chat screen right inside the terminal. Then you can type normal messages like:

Generate an image of a cute lobster mascot

To leave that chat screen later, press Ctrl+C.

#

Option B β€” chat in the browser dashboard
In Ubuntu, type:

openclaw dashboard

That should open or print a local web address. Open that in your browser, then use the chat/webchat area there.

So: no special β€œwake up” command needed. Your Gateway is already awake/running. You just need to enter one of the chat interfaces.

For where you are right now, I’d try the simplest one first:

openclaw chat
pliant hornet
#

Generate a small image of a cute lobster
mascot.

This response is taking longer than
expected. Send another message to continue.
local ready | idle
agent main | session main | ollama/gemma4 |
tokens 21k/128k (17%)

frozen lakeBOT
#

That result is useful. It means: Gemma is probably not actually pressing the image-generation button. It’s just sitting there thinking/talking.

Also I accidentally pointed you at openclaw chat, which says local ready β€” that is okay for chatting, but for diagnosis let’s bypass the chatbot brain entirely.

Please run this in Ubuntu:

openclaw infer image providers --json

This asks: β€œDo I have any image-making machines connected?”

Then run this:

openclaw infer image generate --prompt "small cute lobster mascot" --json
#

Why this matters:

  • If this works, image generation is configured correctly, and the problem is Gemma not using tools well.
  • If this fails, the problem is image provider/API key/quota/config, not Gemma.

For now, don’t wait on that stuck lobster request. It already told us enough.

pliant hornet
#

hobo@DESKTOP-C8NHFT9:~$ openclaw infer image generate --prompt "small cute lobster mascot" --json
16:01:16 [image-generation] candidate failed: openrouter/google/gemini-3.1-flash-image-preview: OpenRouter image generation failed (HTTP 401): Missing Authentication header
Error: OpenRouter image generation failed (HTTP 401): Missing Authentication header

frozen lakeBOT
#

Great, we found the actual problem 🎯

That error means:

OpenClaw tried to make the image, but it did not send your OpenRouter API key.

So this is not a Gemma/Ollama speed problem anymore. It is an API-key-not-being-used problem.

Let’s fix it the simple way.

In Ubuntu, run this command, but replace PASTE_YOUR_KEY_HERE with your real OpenRouter key:

openclaw config set env.OPENROUTER_API_KEY "PASTE_YOUR_KEY_HERE"

Then run:

#
openclaw gateway restart

Then test the image maker again:

openclaw infer image generate --prompt "small cute lobster mascot" --json

Important: do not paste your real key here in Discord. It should look something like sk-or-..., but keep it private.

If that works, then your image-making setup is fixed. After that we can deal with the second issue: getting your chat model to actually use the image tool reliably. Gemma may still struggle with that, but first we need the image tool itself working.

pliant hornet
#

Where do i get my openrouter api key from?

frozen lakeBOT
#

You get it from OpenRouter’s website:

  1. Go here: https://openrouter.ai/keys
  2. Log in / create an account
  3. Click Create Key
  4. Copy the key β€” it usually starts with sk-or-...
  5. Keep it private. Don’t paste it in Discord.

Then in Ubuntu, put it into OpenClaw like this:

openclaw config set env.OPENROUTER_API_KEY "PASTE_THE_KEY_HERE"
openclaw gateway restart

After that, test again:

#
openclaw infer image generate --prompt "small cute lobster mascot" --json

Tiny note: even if OpenRouter has free models, you still need an API key so OpenClaw can talk to your account.

pliant hornet
#

I don't get it. I made an account with OpenRouter, I got the key, I put it where you told me to, and followed your directions to a T. Still got this message

"hobo@DESKTOP-C8NHFT9:~$ openclaw infer image generate --prompt "small cute lobster mascot" --json
16:11:26 [image-generation] candidate failed: openrouter/google/gemini-3.1-flash-image-preview: OpenRouter image generation failed (HTTP 401): Missing Authentication header
Error: OpenRouter image generation failed (HTTP 401): Missing Authentication header
hobo@DESKTOP-C8NHFT9:~$"

frozen lakeBOT
#

Ugh, that’s frustrating β€” and this one is not you being confused. You did the right kind of thing, but OpenClaw still isn’t handing the key to the image tool.

The error is very specific:

β€œMissing Authentication header” = OpenRouter received the image request with no API key attached.

Let’s do one very direct test. This does not permanently fix anything yet; it just proves whether the key itself works.

In Ubuntu, run this, replacing the fake part with your real key:

OPENROUTER_API_KEY="PASTE_YOUR_KEY_HERE" openclaw infer image generate --prompt "small cute lobster mascot" --json

Keep the key private β€” don’t paste the command output here if it includes the key, though it usually won’t.

What the result means:

#
  • If this works: your OpenRouter key is valid, but OpenClaw didn’t save/load it correctly. Easy next fix.
  • If this still says 401: the key may be wrong, disabled, copied with a missing character, or OpenRouter account/billing/quota isn’t allowing that model.

Also, make sure the key starts with something like:

sk-or-

No spaces before/after it, no quote marks copied from the website.

pliant hornet
#

[image-generation] candidate failed: openrouter/google/gemini-3.1-flash-image-preview: OpenRouter image generation failed (HTTP 401): Missing Authentication header
Error: OpenRouter image generation failed (HTTP 401): Missing Authentication header
hobo@DESKTOP-C8NHFT9:~$

frozen lakeBOT
#

Okay β€” I believe you. This means the key is probably not the main problem now.

Plain-English version: OpenClaw has a key, but the request is reaching OpenRouter without the key attached. One common reason is that the OpenRouter web address in config is wrong, especially if it uses http:// instead of https://. When that happens, the request gets redirected and the key can get dropped on the way.

Let’s check the address OpenClaw is using.

Run this:

openclaw config get models.providers.openrouter

Please paste the output, but if you see your API key in there, replace most of it with *** first.

The correct OpenRouter address should be:

#
https://openrouter.ai/api/v1

If yours says http://... or anything weird, fix it with:

openclaw config set models.providers.openrouter.baseUrl "https://openrouter.ai/api/v1"
openclaw gateway restart

Then try again:

openclaw infer image generate --prompt "small cute lobster mascot" --json
#

We’re narrowing this down. The image tool is being called now; it’s just losing auth before OpenRouter accepts it.

pliant hornet
#

hobo@DESKTOP-C8NHFT9:~$ openclaw config get models.providers.openrouter

🦞 OpenClaw 2026.5.7 (eeef486)
Deployed locally, trusted globally, debugged eternally.

Config path not found: models.providers.openrouter

frozen lakeBOT
#

That output is actually helpful. It means OpenRouter exists in your auth list, but not in the main config section the image tool is checking.

Let’s add the missing OpenRouter config explicitly.

Run these one at a time:

openclaw config set models.providers.openrouter.baseUrl "https://openrouter.ai/api/v1"
openclaw config set models.providers.openrouter.apiKey "OPENROUTER_API_KEY"
openclaw gateway restart
#

Then try the lobster again:

openclaw infer image generate --prompt "small cute lobster mascot" --json

Why this should help, in normal-human words: right now OpenClaw has your key saved somewhere, but the image-making part is acting like it doesn’t know where to find it. These commands put up a big sign that says: β€œFor OpenRouter, use this website and use the OpenRouter key.”

pliant hornet
#

hobo@DESKTOP-C8NHFT9:~$ openclaw config set models.providers.openrouter.baseUrl "https://openrouter.ai/api/v1"

🦞 OpenClaw 2026.5.7 (eeef486)
Half butler, half debugger, full crustacean.

Error: Config validation failed: models.providers.openrouter.models: Invalid input: expected array, received undefined
hobo@DESKTOP-C8NHFT9:~$ openclaw config set models.providers.openrouter.apiKey "OPENROUTER_API_KEY"

🦞 OpenClaw 2026.5.7 (eeef486)
I speak fluent bash, mild sarcasm, and aggressive tab-completion energy.

Error: Config validation failed: models.providers.openrouter.baseUrl: Invalid input: expected string, received undefined
hobo@DESKTOP-C8NHFT9:~$

frozen lakeBOT
#

Yep β€” that one is on me. I gave you two β€œhalf commands,” and OpenClaw doesn’t allow half-making a provider config. It needs the whole OpenRouter provider block at once.

Run this one command instead:

openclaw config set models.providers.openrouter '{"baseUrl":"https://openrouter.ai/api/v1","apiKey":"OPENROUTER_API_KEY","models":[{"id":"auto","name":"OpenRouter Auto","input":["text"]},{"id":"google/gemini-3.1-flash-image-preview","name":"Gemini Image via OpenRouter","input":["text","image"]}]}' --strict-json

Then:

openclaw gateway restart

Then test again:

#
openclaw infer image generate --prompt "small cute lobster mascot" --json

What happened: I tried to add baseUrl first, but OpenClaw said β€œif you’re creating an OpenRouter provider config, I also need a models list.” So now we’re giving it the whole thing in one shot.

pliant hornet
#

openclaw infer image generate --prompt "small cute lobster mascot" --jsonhobo@DESKTOP-C8NHFT9:~$ openclaw infer image generate --prompt "small cute lobster mascot" --json
16:51:46 [image-generation] candidate failed: openrouter/google/gemini-3.1-flash-image-preview: OpenRouter image generation failed (HTTP 401): Missing Authentication header
Error: OpenRouter image generation failed (HTTP 401): Missing Authentication header
hobo@DESKTOP-C8NHFT9:~$

frozen lakeBOT
#

Okay, that’s maddening β€” thank you for sticking with it. At this point I don’t want to keep guessing.

The error still says OpenRouter is receiving no login badge at all from OpenClaw. So let’s check what OpenClaw thinks it has configured.

Please run these two commands and paste the output:

openclaw infer image providers --json
openclaw models auth list --provider openrouter

Also run this one: