openclaw - 💡(How to fix) Fix Plugin tools registered via api.registerTool() are not visible to agents [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61790Fetched 2026-04-08 02:54:29
View on GitHub
Comments
2
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×2

Plugin tools registered via api.registerTool() do not appear in the agent's available tool list, even though the plugin shows as loaded and register() completes successfully.

Root Cause

Plugin tools registered via api.registerTool() do not appear in the agent's available tool list, even though the plugin shows as loaded and register() completes successfully.

Code Example

import { definePluginEntry } from 'openclaw/plugin-sdk/core';
import { Type } from '@sinclair/typebox';

export default definePluginEntry({
  id: 'test-plugin',
  name: 'Test Plugin',
  description: 'Test tool registration',
  register(api: any) {
    api.registerTool((_ctx: any) => ({
      name: 'test_tool',
      label: 'Test Tool',
      description: 'A test tool',
      parameters: Type.Object({
        message: Type.String({ description: 'Test message' }),
      }),
      async execute(_id: string, params: any) {
        return { content: [{ type: 'text', text: `Test: ${params.message}` }] };
      },
    }));
  },
});
RAW_BUFFERClick to expand / collapse

Description

Plugin tools registered via api.registerTool() do not appear in the agent's available tool list, even though the plugin shows as loaded and register() completes successfully.

Environment

  • OpenClaw version: 2026.4.2
  • OS: macOS 26.2 (arm64)
  • Node: 25.8.1

Steps to Reproduce

  1. Create a minimal plugin with api.registerTool():
import { definePluginEntry } from 'openclaw/plugin-sdk/core';
import { Type } from '@sinclair/typebox';

export default definePluginEntry({
  id: 'test-plugin',
  name: 'Test Plugin',
  description: 'Test tool registration',
  register(api: any) {
    api.registerTool((_ctx: any) => ({
      name: 'test_tool',
      label: 'Test Tool',
      description: 'A test tool',
      parameters: Type.Object({
        message: Type.String({ description: 'Test message' }),
      }),
      async execute(_id: string, params: any) {
        return { content: [{ type: 'text', text: `Test: ${params.message}` }] };
      },
    }));
  },
});
  1. Install via openclaw plugins install --link <path>
  2. Add plugin ID to plugins.allow and set plugins.entries.<id>.enabled: true
  3. Restart gateway
  4. Check agent's available tool list

Expected Behavior

Per docs (building-plugins.md), required tools (without optional: true) should be "always available" to the agent without additional configuration.

Actual Behavior

  • openclaw plugins list --verbose shows: activated: yes, imported: yes, registrationMode: full
  • register() is called and completes without errors
  • api.registerTool is a real function and executes successfully
  • Source code confirms registerTool() unconditionally pushes to registry.tools
  • But the agent's tool list only shows built-in tools (read, write, edit, exec, etc.)
  • No plugin tools appear, regardless of tools.allow configuration

Additional Context

  • Verified with two independent plugins (both show same behavior)
  • The registry.tools array likely contains the plugin tools, but they are not routed to the agent's available tool list
  • Tried tools.allow: ["test_tool"], tools.allow: ["group:plugins"], and no tools config — none worked
  • Built-in tools like memory_get / memory_search work fine (these appear to be core tools, not from plugins)

extent analysis

TL;DR

The plugin tools registered via api.registerTool() may not be appearing in the agent's available tool list due to a potential issue with the routing or configuration of the registry.tools array.

Guidance

  • Verify that the registry.tools array indeed contains the plugin tools after the register() function completes, to confirm that the issue lies in the routing to the agent's tool list.
  • Check the documentation for any specific configuration requirements for plugin tools to be visible to the agent, such as a specific tools.allow configuration or a required flag in the registerTool() call.
  • Inspect the code responsible for populating the agent's available tool list to ensure it correctly handles plugin tools registered via api.registerTool().
  • Consider adding logging or debugging statements to the plugin registration and tool listing code to gain more insight into the issue.

Example

No specific code example can be provided without further information on the internal workings of the OpenClaw plugin system and the agent's tool list population.

Notes

The issue seems to be related to the interaction between the plugin registration process and the agent's tool list configuration. Without more detailed information on the internal mechanics of OpenClaw, it's challenging to provide a definitive solution. The steps outlined in the guidance section are intended to help narrow down the cause of the issue.

Recommendation

Apply workaround: Given the uncertainty around the root cause, attempting to manually configure or log the registry.tools array and the agent's tool list population process may provide more insight and potentially lead to a workaround.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING