defaultDiscordTools
The Discord tools the adapter ships — lookup_discord_user resolves a name/handle to a <@id> mention.
Overview
defaultDiscordTools is the flat list of universal Discord tools the package ships. It is not auto-applied — you spread it explicitly, so there's no hidden behavior. Today it contains one tool, also exported individually as lookupDiscordUserTool.
Usage
Spread it into createBot({ tools }):
import { defaultDiscordTools } from "@copilotkit/bot-discord";
const bot = createBot({
// …
tools: [...defaultDiscordTools, ...myAppTools],
});lookup_discord_user
Resolves a person to a Discord user ID so the agent can @-mention them properly.
Prop
Type
Returns (to the agent):
- On success —
{ id, name, mention }, wherementionis the ready-to-paste<@id>string the agent should put verbatim in its reply. - On a genuine miss — a plain string
No Discord user found matching "…"so the agent writes the plain name instead. - On a lookup failure — if the directory search throws, a plain string
Couldn't resolve a Discord user for "…" (lookup unavailable).so the agent degrades gracefully rather than erroring.
Under the hood it calls thread.lookupUser(query), the capability-gated directory search this adapter backs.
Related
- defaultDiscordContext — the companion context entries (tagging procedure)
- defineBotTool — how these tools are defined
- discord() — the adapter