Loading...
Loading...
Loading...
// Error handling
server.tool("risky_operation", "May fail", {}, async () => {
try {
const result = await performOperation();
return { content: [{ type: "text", text: result }] };
} catch (error) {
return {
content: [{
type: "text",
text: `Error: ${error.message}`,
}],
isError: true,
};
}
});
// Logging
server.server.sendLoggingMessage({
level: "info",
data: "Server started successfully",
});