listAgentTools()
This method lists tool bindings for one agent.
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'; return client.ai.listAgentTools(agentId);}Signature
function listAgentTools( agentId: string, client?: WachtClient,): Promise<PaginatedResponse<AiTool>>Parameters
›agentId: string;
agentId: string;Target agent id.
Return value
›data?: AiTool[] | undefined;
data?: AiTool[] | undefined;Current page result items.
›has_more?: boolean | undefined;
has_more?: boolean | undefined;Whether additional pages are available.
›limit?: number | undefined;
limit?: number | undefined;Effective page size when returned by backend.
›offset?: number | undefined;
offset?: number | undefined;Effective offset when returned by backend.
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;}