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.
useCreateAgent(options?: MutationOpts<Agent, CreateAgentParams>)Types: Agent · CreateAgentParams
useDeleteAgent mutation
Soft-delete an agent.
useDeleteAgent(options?: MutationOpts<SuccessResponse, string>)Types: SuccessResponse
useListAgents query
List agents.
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.
usePurgeAgent(options?: MutationOpts<SuccessResponse, PurgeAgentParams>)Types: SuccessResponse · PurgeAgentParams
useRestoreAgent composite
Restore a soft-deleted agent.
useRestoreAgent(options?: MutationOpts<Agent, string>)Types: Agent
useRetrieveAgent query
Get an agent by ID.
useRetrieveAgent(id: string, options?: QueryOpts<Agent>)Types: Agent
useSyncAgentMcpServers composite
Replace all MCP server assignments for an agent in a single PUT.
useSyncAgentMcpServers(options?: MutationOpts<SuccessResponse, SyncAgentMcpServersParams>)Types: SuccessResponse · SyncAgentMcpServersParams
const syncMcp = useSyncAgentMcpServers();
syncMcp.mutate({
agentId: "agt_abc123",
mcpServerIds: ["mcp_abc"],
});useSyncAgentSkills composite
Replace all skill assignments for an agent in a single PUT.
useSyncAgentSkills(options?: MutationOpts<SuccessResponse, SyncAgentSkillsParams>)Types: SuccessResponse · SyncAgentSkillsParams
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.
useSyncAgentTools(options?: MutationOpts<SuccessResponse, SyncAgentToolsParams>)Types: SuccessResponse · SyncAgentToolsParams
const syncTools = useSyncAgentTools();
syncTools.mutate({
agentId: "agt_abc123",
toolIds: ["tol_search", "tol_summarize"],
});useUpdateAgent mutation
Update an agent.
useUpdateAgent(options?: MutationOpts<Agent, UpdateAgentParams>)Types: Agent · UpdateAgentParams