Skip to content

DF0015: Agent Tool Already Registered

Package: devframe

Experimental

The agent-native surface is experimental and may change without a major version bump until it stabilizes.

Message

Agent tool "{id}" is already registered.

Cause

ctx.agent.registerTool() was called with an id that collides with:

  • an already-registered agent tool, or
  • an RPC function whose agent field already exposes it under the same id.

Agent tool ids must be unique across both sources so that invoke(id, args) has an unambiguous target.

Fix

Pick a distinct id or unregister the existing tool before re-registering:

ts
const handle = ctx.agent.registerTool({ id: 'my-tool', /* ... */ })
// later...
handle.unregister()
ctx.agent.registerTool({ id: 'my-tool', /* new config */ })

Source

packages/devframe/src/node/host-agent.ts

Released under the MIT License.