MCPcopy Create free account
hub / github.com/modelcontextprotocol/inspector / cancelTask

Function cancelTask

client/src/App.tsx:1246–1260  ·  view source on GitHub ↗
(taskId: string)

Source from the content-addressed store, hash-verified

1244 }, [listMcpTasks, nextTaskCursor]);
1245
1246 const cancelTask = async (taskId: string) => {
1247 try {
1248 const response = await cancelMcpTask(taskId);
1249 setTasks((prev) => prev.map((t) => (t.taskId === taskId ? response : t)));
1250 if (selectedTask?.taskId === taskId) {
1251 setSelectedTask(response);
1252 }
1253 clearError("tasks");
1254 } catch (e) {
1255 setErrors((prev) => ({
1256 ...prev,
1257 tasks: (e as Error).message ?? String(e),
1258 }));
1259 }
1260 };
1261
1262 const handleRootsChange = async () => {
1263 await sendNotification({ method: "notifications/roots/list_changed" });

Callers

nothing calls this directly

Calls 1

clearErrorFunction · 0.85

Tested by

no test coverage detected