AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { SeekPage } from '@activepieces/core-utils';
import {
Agent,
AgentWithUsage,
GetAgentRequest,
AgentMovePreview,
AgentSummary,
CreateAgentRequest,
AgentRunListItem,
ListAgentRunsRequest,
ListAgentsRequest,
MoveAgentRequest,
UpdateAgentRequest,
} from '@activepieces/shared';
import { api } from '@/lib/api';
export const agentsApi = {
list(request: ListAgentsRequest): Promise<SeekPage<AgentSummary>> {
return api.get<SeekPage<AgentSummary>>('/v1/agents', request);
},
movePreview(id: string, projectId: string): Promise<AgentMovePreview> {
return api.get<AgentMovePreview>(`/v1/agents/${id}/move-preview`, {
projectId,
});
},
move(id: string, request: MoveAgentRequest): Promise<Agent> {
return api.post<Agent>(`/v1/agents/${id}/move`, request);
},
get(id: string, request?: GetAgentRequest): Promise<AgentWithUsage> {
return api.get<AgentWithUsage>(`/v1/agents/${id}`, {
...(request?.includeUsage === true ? { includeUsage: 'true' } : {}),
});
},
create(request: CreateAgentRequest): Promise<Agent> {
return api.post<Agent>('/v1/agents', request);
},
update(id: string, request: UpdateAgentRequest): Promise<Agent> {
return api.post<Agent>(`/v1/agents/${id}`, request);
},
delete(id: string): Promise<void> {
return api.delete<void>(`/v1/agents/${id}`);
},
getRun(id: string, projectId: string): Promise<AgentRunListItem> {
return api.get<AgentRunListItem>(`/v1/agents/conversations/runs/${id}`, {
projectId,
});
},
listRuns(request: ListAgentRunsRequest): Promise<SeekPage<AgentRunListItem>> {
return api.get<SeekPage<AgentRunListItem>>(
'/v1/agents/conversations/runs',
request,
);
},
};