-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reorganizing Crashlytics MCP Tools #9594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,3 +32,4 @@ lib/ | |
| dev/ | ||
| clean/ | ||
| .gemini/ | ||
| .env | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { resource } from "../../resource"; | ||
|
|
||
| export const RESOURCE_CONTENT = ` | ||
| ### Firebase App ID | ||
| The Firebase App ID is used to identify a mobile or web client application to Firebase back end services such as Crashlytics or Remote Config. Use the information below to find the developer's App ID. | ||
|
|
||
| 1. **PRIORITIZE REMEMBERED APP ID ENTRIES** If an entry for this directory exists in the remembered app ids, use the remembered app id | ||
| for this directory without presenting any additional options. | ||
| i. If there are multiple remembered app ids for this directory, ask the user to choose one by providing | ||
| a numbered list of all the package names. Tell them that these values came from memories and how they can modify those values. | ||
| 2. **IF THERE IS NO REMEMBERED ENTRY FOR THIS DIRECTORY** Use the app IDs from the \`firebase_get_environment\` tool. | ||
| i. If you've already called this tool, use the previous response from context. | ||
| ii. If the 'Detected App IDs' is set to <NONE>, ask the user for the value they want to use. | ||
| iii. If there are multiple 'Detected App IDs', ask the user to choose one by providing | ||
| a numbered list of all the package names and app ids. | ||
| 3. **IF THERE IS A REMEMBERED VALUE BUT IT DOES NOT MATCH ANY DETECTED APP IDS** Ask if the user would like to replace the value with one of | ||
| the detected values. | ||
| i. **Description:** A valid app ID to remember contains four colon (":") delimited parts: a version | ||
| number (typically "1"), a project number, a platform type ("android", "ios", or "web"), | ||
| and a sequence of hexadecimal characters. | ||
| ii. Replace the value for this directory with this valid app id, the android package name or ios bundle identifier, and the project directory. | ||
| 4. **IF THERE IS NO REMEMBERED ENTRY FOR THIS DIRECTORY** Ask if the user would like to remember the app id selection | ||
| i. **Description:** A valid app ID to remember contains four colon (":") delimited parts: a version | ||
| number (typically "1"), a project number, a platform type ("android", "ios", or "web"), | ||
| and a sequence of hexadecimal characters. | ||
| ii. Store the valid app id value, the android package name or ios bundle identifier, and the project directory. | ||
| `.trim(); | ||
|
|
||
| export const app_id = resource( | ||
| { | ||
| uri: "firebase://guides/app_id", | ||
| name: "app_id_guide", | ||
| title: "Firebase App Id Guide", | ||
| description: | ||
| "guides the coding agent through choosing a Firebase App ID in the current project", | ||
| }, | ||
| async (uri) => { | ||
| return { | ||
| contents: [{ uri, type: "text", text: RESOURCE_CONTENT }], | ||
| }; | ||
| }, | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { resource } from "../../resource"; | ||
|
|
||
| export const RESOURCE_CONTENT = ` | ||
| ### Instructions for Working with Firebase Crashlytics Tools | ||
|
|
||
| Only ask the user one question at a time. Do not proceed without user instructions. Upon receiving user instructions, refer to the relevant resources for guidance. | ||
|
|
||
| Use the \`firebase_read_resources\` tool to access the following guides. | ||
|
|
||
| 1. [Firebase App Id Guide](firebase://guides/app_id) | ||
| This guide provides crucial instructions for obtaining the application's App Id which is required for all API calls. | ||
|
|
||
| 2. [Firebase Crashlytics Reports Guide](firebase://guides/crashlytics/reports) | ||
| This guide details how to request and use aggregated numerical data from Crashlytics. The agent should read this guide before requesting any report. | ||
|
|
||
| 3. [Firebase Crashlytics Issues Guide](firebase://guides/crashlytics/issues) | ||
| This guide details how to work with issues within Crashlytics. The agent should read this guide before prioritizing issues or presenting issue data to the user. | ||
|
|
||
| 4. [Investigating Crashlytics Issues](firebase://guides/crashlytics/investigations) | ||
| This guide provides instructions on investigating the root causes of crashes and exceptions reported in Crashlytics issues. | ||
|
|
||
| ### Check That You Are Connected | ||
|
|
||
| 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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We didn't have this step before - how has this played out in your testing? My one concern here is that it increases token consumption by default without interaction from the user. That happens not infrequently anyway, but curious if it happens more with this instruction. |
||
| a. Call the \`firebase_get_environment\` tool if you need to find the app_id. | ||
| b. Call the \`crashlytics_get_report\` tool to read the \`topVersions\` report. | ||
| 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. | ||
| d. Help the user resolve any issues that arise when trying to connect. | ||
|
|
||
| After confirming you can access Crashlytics, inquire about the desired actions. Your capabilities include: | ||
|
|
||
| - Reading Crashlytics reports. | ||
| - Investigating bug reports using Crashlytics event data. | ||
| - Proposing code changes to resolve identified bugs. | ||
| `.trim(); | ||
|
|
||
| export const crashlytics_connect = resource( | ||
| { | ||
| uri: "firebase://guides/crashlytics/connect", | ||
| name: "crashlytics_connect_guide", | ||
| title: "Firebase Crashlytics Connect Guide", | ||
| description: "Guides the coding agent to connect to Firebase Crashlytics.", | ||
| }, | ||
| async (uri) => { | ||
| return { | ||
| contents: [{ uri, type: "text", text: RESOURCE_CONTENT }], | ||
| }; | ||
| }, | ||
| ); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a strong enough statement? I've seen it ignore this pretty readily without emphasis - asking multiple questions at a time being the main thing it tries to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think we might want to remove this entirely and let the agent and developer determine the working agreement. What if the agent is meant to be autonomous?