updateTool()
This method updates an AI tool definition.
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 toolId: string = 'toolid-123'; const request: UpdateAiToolRequest = { name: 'fetch-user-profile-v2', }; return client.ai.updateTool(toolId, request);}Signature
function updateTool( toolId: string, request: UpdateAiToolRequest, client?: WachtClient,): Promise<AiTool>Parameters
›toolId: string;
toolId: string;Target tool id.
›request: UpdateAiToolRequest;
request: UpdateAiToolRequest;Request payload object sent to the backend API.
›name?: string | undefined;
name?: string | undefined;Display name for the target resource.
Return value
›id?: string | undefined;
id?: string | undefined;Tool id.
›name?: string | undefined;
name?: string | undefined;Tool display name.
›kind?: string | undefined;
kind?: string | undefined;Tool kind/type.
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;}