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

Function sendNotification

client/src/lib/hooks/useConnection.ts:334–361  ·  view source on GitHub ↗
(notification: ClientNotification)

Source from the content-addressed store, hash-verified

332 };
333
334 const sendNotification = async (notification: ClientNotification) => {
335 if (!mcpClient) {
336 const error = new Error("MCP client not connected");
337 toast({
338 title: "Error",
339 description: error.message,
340 variant: "destructive",
341 });
342 throw error;
343 }
344
345 try {
346 await mcpClient.notification(notification);
347 // Log successful notifications
348 pushHistory(notification);
349 } catch (e: unknown) {
350 if (e instanceof McpError) {
351 // Log MCP protocol errors
352 pushHistory(notification, { error: e.message });
353 }
354 toast({
355 title: "Error",
356 description: e instanceof Error ? e.message : String(e),
357 variant: "destructive",
358 });
359 throw e;
360 }
361 };
362
363 const checkProxyHealth = async () => {
364 try {

Callers 1

handleRootsChangeFunction · 0.85

Calls 2

toastFunction · 0.85
pushHistoryFunction · 0.85

Tested by

no test coverage detected