Agents hooks

Hand-written shim. Generated CRUD hooks via ./agents.gen. useSyncAgent{Tools,Skills,McpServers} stay hand-written — they target the surviving sub-resource sync classes on client.agents.

Hooks

useCreateAgent mutation

Create an agent.

TypeScript
useCreateAgent(options?: MutationOpts<Agent, CreateAgentParams>)

Types: Agent · CreateAgentParams

useDeleteAgent mutation

Soft-delete an agent.

TypeScript
useDeleteAgent(options?: MutationOpts<SuccessResponse, string>)

Types: SuccessResponse

useListAgents query

List agents.

TypeScript
useListAgents(params?: Omit<ListAgentsParams, | > & { filter?: AgentFilter; orderBy?: AgentOrderBy[]; } & AgentShorthands, options?: QueryOpts<Page<Agent>>)

Types: ListAgentsParams · AgentFilter · AgentOrderBy · AgentShorthands · Page · Agent

usePurgeAgent composite

Permanently delete a soft-deleted agent.

TypeScript
usePurgeAgent(options?: MutationOpts<SuccessResponse, PurgeAgentParams>)

Types: SuccessResponse · PurgeAgentParams

useRestoreAgent composite

Restore a soft-deleted agent.

TypeScript
useRestoreAgent(options?: MutationOpts<Agent, string>)

Types: Agent

useRetrieveAgent query

Get an agent by ID.

TypeScript
useRetrieveAgent(id: string, options?: QueryOpts<Agent>)

Types: Agent

useSyncAgentMcpServers composite

Replace all MCP server assignments for an agent in a single PUT.

TypeScript
useSyncAgentMcpServers(options?: MutationOpts<SuccessResponse, SyncAgentMcpServersParams>)

Types: SuccessResponse · SyncAgentMcpServersParams

TypeScript
const syncMcp = useSyncAgentMcpServers();
syncMcp.mutate({
  agentId: "agt_abc123",
  mcpServerIds: ["mcp_abc"],
});

useSyncAgentSkills composite

Replace all skill assignments for an agent in a single PUT.

TypeScript
useSyncAgentSkills(options?: MutationOpts<SuccessResponse, SyncAgentSkillsParams>)

Types: SuccessResponse · SyncAgentSkillsParams

TypeScript
const syncSkills = useSyncAgentSkills();
syncSkills.mutate({
  agentId: "agt_abc123",
  skillIds: ["skl_system_aeontel_libraries"],
});

useSyncAgentTools composite

Replace all tool assignments for an agent in a single PUT. Pass the desired set; omitted IDs are unassigned. Invalidates both agent and tool query caches on success.

TypeScript
useSyncAgentTools(options?: MutationOpts<SuccessResponse, SyncAgentToolsParams>)

Types: SuccessResponse · SyncAgentToolsParams

TypeScript
const syncTools = useSyncAgentTools();
syncTools.mutate({
  agentId: "agt_abc123",
  toolIds: ["tol_search", "tol_summarize"],
});

useUpdateAgent mutation

Update an agent.

TypeScript
useUpdateAgent(options?: MutationOpts<Agent, UpdateAgentParams>)

Types: Agent · UpdateAgentParams