firebase-tools
Version:
Command-Line Interface for Firebase
40 lines (39 loc) • 1.83 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.list_top_issues = void 0;
const zod_1 = require("zod");
const tool_js_1 = require("../../tool.js");
const util_js_1 = require("../../util.js");
const listTopIssues_js_1 = require("../../../crashlytics/listTopIssues.js");
exports.list_top_issues = (0, tool_js_1.tool)({
name: "list_top_issues",
description: "List the top crashes from crashlytics happening in the application.",
inputSchema: zod_1.z.object({
app_id: zod_1.z
.string()
.optional()
.describe("AppId for which the issues list is fetched. Defaults to the first appId provided by firebase_list_apps."),
issue_count: zod_1.z
.number()
.optional()
.describe("Number of issues that needs to be fetched. Defaults to 10 if unspecified."),
issue_type: zod_1.z
.enum(["FATAL", "NON-FATAL", "ANR"])
.optional()
.describe("Types of issues that can be fetched comma-separated. Defaults to `FATAL` (Crashes). Other values include NON-FATAL (Non-fatal issues), ANR (Application not responding)."),
}),
annotations: {
title: "List Top Crashlytics Issues.",
readOnlyHint: true,
},
_meta: {
requiresAuth: true,
requiresProject: true,
},
}, async ({ app_id, issue_type, issue_count }, { projectId }) => {
if (!app_id)
return (0, util_js_1.mcpError)(`Must specify 'app_id' parameter.`);
issue_type !== null && issue_type !== void 0 ? issue_type : (issue_type = "FATAL");
issue_count !== null && issue_count !== void 0 ? issue_count : (issue_count = 10);
return (0, util_js_1.toContent)(await (0, listTopIssues_js_1.listTopIssues)(projectId, app_id, issue_type, issue_count));
});
;