Skip to content

Commit f9c1bb8

Browse files
schneclemaxl0rd
authored andcommitted
Update instructions to be less prescriptive about process but retain formatting. Also update tool descriptions to encourage resource reading.
1 parent 80e2475 commit f9c1bb8

File tree

7 files changed

+17
-22
lines changed

7 files changed

+17
-22
lines changed

src/mcp/resources/guides/crashlytics_connect.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Use the \`firebase_read_resources\` tool to access the following guides.
2222
### Check That You Are Connected
2323
2424
Verify that you can read the app's Crashlytics data by getting the topVersions report. This report will tell you which app versions have the most events.
25-
a. Call the \`firebase_get_environment\` tool if you need to find the app_id.
25+
a. Use the firebase://guides/app_id if you need to find the app_id.
2626
b. Call the \`crashlytics_get_report\` tool to read the \`topVersions\` report.
2727
c. If you haven't read the reports guide, then the tool will include it in the response. This is OK. Simply call the tool again.
2828
d. Help the user resolve any issues that arise when trying to connect.
2929
30-
After confirming you can access Crashlytics, inquire about the desired actions. Your capabilities include:
30+
After confirming you can access Crashlytics, ask the user what they would like help with. Your capabilities include:
3131
32-
- Reading Crashlytics reports.
33-
- Investigating bug reports using Crashlytics event data.
32+
- Reading Crashlytics reports to prioritize or find important issues. Before fetching issues or reports, you MUST read both the firebase://guides/crashlytics/reports and firebase://guides/crashlytics/issues guides to know how to best help users with this.
33+
- Investigating bug reports using Crashlytics event data. Before attempting to investigate an individual issue, you MUST read the firebase://guides/crashlytics/investigations guide to know how to best help users with this.
3434
- Proposing code changes to resolve identified bugs.
3535
`.trim();
3636

src/mcp/resources/guides/crashlytics_investigations.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ const RESOURCE_CONTENT = `
1414
5. Determine possible root causes for the crash - no more than 5 potential root causes.
1515
6. Critique your own determination, analyzing how plausible each scenario is given the crash details.
1616
7. Choose the most likely root cause given your analysis.
17-
8. Write out a plan for the most likely root cause using the following criteria:
18-
8a. Write out a description of the issue and including
19-
* A brief description of the cause of the issue
20-
* A determination of your level of confidence in the cause of the issue using your analysis.
21-
* A determination of which library is at fault, this codebase or a dependent library
22-
* A determination for how complex the fix will be
23-
8b. The plan should include relevant files to change
24-
8c. The plan should include a test plan for how the user might verify the fix
25-
8d. Use the following format for the plan:
17+
8. Create a plan for the most likely root cause using the following format for the plan:
2618
2719
## Cause
2820
<A description of the root cause leading to the issue>
@@ -43,10 +35,7 @@ const RESOURCE_CONTENT = `
4335
1. <Another possible root cause>
4436
2. <Another possible root cause>
4537
46-
9. Present the plan to the user and get approval before making the change.
47-
10. Only if they approve the plan, create a fix for the issue.
48-
10a. Be mindful of API contracts and do not add fields to resources without a clear way to populate those fields
49-
10b. If there is not enough information in the crash report to find a root cause, describe why you cannot fix the issue instead of making a guess.
38+
9. If there is not enough information in the crash report to find a root cause, describe why you cannot fix the issue instead of making a guess.
5039
`.trim();
5140

5241
export const crashlytics_investigations = resource(

src/mcp/resources/guides/crashlytics_issues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { resource } from "../../resource";
33
const RESOURCE_CONTENT = `
44
### How to Display Issues
55
6-
When displaying a list of issues, favor the following format:
6+
When displaying a list of issues, use the following format:
77
88
1. Issue <issue id>
99
* <the issue title>

src/mcp/resources/guides/crashlytics_reports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ When setting report filters adhere to the following instructions.
8888
* Report responses grouped by issue will include a sample event URI. Use the "crashlytics_batch_get_events" tool to fetch the complete record for any sample event.
8989
9090
* When investigating an issue, use the appropriate top devices and top operating systems reports to understand what systems are impacted by the problem. Pass the "issueId" in the filter to narrow any report to a specific issue.
91-
9291
`.trim();
9392

9493
export const crashlytics_reports = resource(

src/mcp/tools/core/get_environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const get_environment = tool(
9595
{
9696
name: "get_environment",
9797
description:
98-
"Use this to retrieve the current Firebase **environment** configuration for the Firebase CLI and Firebase MCP server, including current authenticated user, project directory, active Firebase Project, and more.",
98+
"Use this to retrieve the current Firebase **environment** configuration for the Firebase CLI and Firebase MCP server, including current authenticated user, project directory, active Firebase Project, and more. All tools require the user to be authenticated, but not all information is required for all tools. Pay attention to the tool requirements for which pieces of information are required.",
9999
inputSchema: z.object({}),
100100
annotations: {
101101
title: "Get Firebase Environment Info",

src/mcp/tools/crashlytics/events.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ function formatFrames(origFrames: Frame[], maxFrames = 20): string[] {
4747
// Formats an event into more legible, token-efficient text content sections
4848

4949
function toText(event: Event): Record<string, string> {
50+
if (!event) {
51+
return {};
52+
}
5053
const result: Record<string, string> = {};
5154
for (const [key, value] of Object.entries(event)) {
5255
if (key === "logs") {
@@ -62,7 +65,7 @@ function toText(event: Event): Record<string, string> {
6265
const breadcrumbs = (value as Breadcrumb[]) || [];
6366
const slicedBreadcrumbs = breadcrumbs.length > 10 ? breadcrumbs.slice(-10) : breadcrumbs;
6467
const breadcrumbLines = slicedBreadcrumbs.map((b) => {
65-
const paramString = Object.entries(b.params)
68+
const paramString = Object.entries(b?.params || {})
6669
.map(([k, v]) => `${k}: ${v}`)
6770
.join(", ");
6871
const params = paramString ? ` { ${paramString} }` : "";

src/mcp/tools/crashlytics/reports.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export const get_report = tool(
4040
{
4141
name: "get_report",
4242
description:
43-
`Use this to request numerical reports from Crashlytics. Reports contain aggregated metrics describing the number of crash events and number of impacted end users. The reports are grouped by different dimensions such as issue, version or device.
43+
`**REQUIRED PREREQUISITE:** READ firebase://guides/app_id, firebase://guides/crashlytics/reports, and firebase://guides/crashlytics/issues.
44+
**DO NOT FETCH DATA FIRST. IT WILL CAUSE ERRORS AND WASTE TOKENS AND TIME. READING THE GUIDES IS THE MOST EFFICIENT WAY TO GET THE ANSWERS YOU WANT.**
45+
AGENTS MUST READ these guides to fetch, format, and interpret report results or TOOL CALLS WILL FAIL.
46+
47+
Use this to request numerical reports from Crashlytics.
4448
`.trim(),
4549
inputSchema: ReportInputSchema,
4650
annotations: {

0 commit comments

Comments
 (0)