getAgent()
Returns the full agent-with-details payload for the requested agent id.
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 getAgent(agentId: string) { const client = await wachtClient(); return client.ai.getAgent(agentId);}Signature
function getAgent( agentId: string,): Promise<AiAgentWithDetails>Parameters
›agentId?: string | undefined;
agentId?: string | undefined;Target agent id.
Return value
›id?: string | undefined;
id?: string | undefined;Agent id.
›name?: string | undefined;
name?: string | undefined;Agent display name.
›instructions?: string | undefined;
instructions?: string | undefined;Agent instructions/system prompt.
›model?: string | undefined;
model?: string | undefined;Configured default model.
Behavior
- Fetches a single resource by identifier or query context.
- Use this result as the source of truth before update, replay, or delete flows.