@channel.io/be-user-chat-mcp
Version:
Backend UserChat Model Context Protocol server for Channel.io
19 lines • 949 B
JavaScript
import { z } from "zod";
import { getSentryLogDetails } from "../services/sentry.service.js";
import { registerMcpTool, formatResult } from "../utils/helper.util.js";
const GetSentryIssueDataInputSchema = z.object({
issue_id: z.string().min(1, "issue_id is required"),
event_id: z.string().optional(),
});
export function registerSentryTool(server, getContext) {
registerMcpTool(server, "get_sentry_issue_data", GetSentryIssueDataInputSchema, async (input, context) => {
const { issue_id, event_id } = input;
const [sentryLogDetailsResult] = await Promise.allSettled([
getSentryLogDetails(issue_id, event_id, context),
]);
return {
sentryLogDetails: formatResult(sentryLogDetailsResult, `Sentry log details not found for issue_id: ${issue_id}`, `Error fetching Sentry log details for issue_id: ${issue_id}`),
};
}, getContext);
}
//# sourceMappingURL=sentry.tool.js.map