add update and delete mutations

This commit is contained in:
Dustin Healy 2025-06-27 12:30:38 -07:00
parent 568ec2f7d5
commit 5a7bf0b35f
8 changed files with 114 additions and 11 deletions

View file

@ -841,3 +841,26 @@ export const createMCP = (mcp: ag.MCP): Promise<Record<string, unknown>> => {
mcp,
);
};
export const updateMCP = ({
mcp_id,
data,
}: {
mcp_id: string;
data: ag.MCP;
}): Promise<Record<string, unknown>> => {
return request.put(
endpoints.agents({
path: `tools/${mcp_id}`,
}),
data,
);
};
export const deleteMCP = ({ mcp_id }: { mcp_id: string }): Promise<Record<string, unknown>> => {
return request.delete(
endpoints.agents({
path: `tools/${mcp_id}`,
}),
);
};

View file

@ -321,6 +321,13 @@ export type UpdatePluginAuthOptions = MutationOptions<types.TUser, types.TUpdate
export type CreateMCPMutationOptions = MutationOptions<Record<string, unknown>, MCP>;
export type UpdateMCPMutationOptions = MutationOptions<
Record<string, unknown>,
{ mcp_id: string; data: MCP }
>;
export type DeleteMCPMutationOptions = MutationOptions<Record<string, unknown>, { mcp_id: string }>;
export type ToolParamsMap = {
[Tools.execute_code]: {
lang: string;