detachAgentTool()
This method manages AI tool definitions or agent-to-tool bindings.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function example() { const client = await wachtClient(); const agentId: string = 'agentid-123'; const toolId: string = 'toolid-123'; return client.ai.detachAgentTool(agentId, toolId);}Signature
function detachAgentTool( agentId: string, toolId: string, client?: WachtClient,): Promise<void>Parameters
›agentId: string;
agentId: string;Target agent id.
›toolId: string;
toolId: string;Target tool id.
Examples
AI usage pattern
import { wachtClient } from '@wacht/nextjs/server';export async function attachTool(agentId: string) { const client = await wachtClient(); const tool = await client.ai.createTool({ name: 'fetch-user-profile', kind: 'api', configuration: {}, }); await client.ai.attachAgentTool(agentId, tool.id); return tool;}