Skip to content

Conversation

maxl0rd
Copy link
Contributor

@maxl0rd maxl0rd commented Sep 15, 2025

Description

Refactoring for maintainability and consistency

  • Consolidating the APIs that call getReport into one
  • Consolidating individual APIs by resource (reports, events, issues, notes)
  • Standardizing the Crashlytics MCP tools to use terminology more consistent with
    the API resources and verbs.
  • Applying consistent naming, case and error handling conventions

Expanding the functionality of MCP tools

  • Allowing all reports tools to use the full range of filtering options,
    and combine them as needed.
  • Adding all filters for reading events
  • Enabling reports to also use issue id filters for issue-level breakdowns

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @maxl0rd, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a major reorganization and enhancement of the Crashlytics tools. The changes aim to improve maintainability and consistency by consolidating existing API interactions into a more structured, resource-oriented approach. It also significantly expands the filtering capabilities for various Crashlytics reports and event listings, providing more granular control and detailed insights for users.

Highlights

  • API Consolidation and Refactoring: The Crashlytics API calls have been significantly refactored and consolidated. Previously separate functions like addNote, deleteNote, getIssueDetails, getSampleCrash, listNotes, listTopDevices, listTopIssues, listTopOperatingSystems, listTopVersions, and updateIssue have been replaced by new, more generalized functions grouped by resource (e.g., issues.ts, notes.ts, events.ts, reports.ts).
  • Standardized Terminology and Filtering: The MCP tools now use terminology more consistent with Crashlytics API resources and verbs. A new filters.ts file introduces standardized schemas (ApplicationIdSchema, IssueIdSchema, EventFilterSchema) and a utility function (filterToUrlSearchParams) to convert tool parameters into AIP-160 style URL parameters, allowing for a full range of filtering options across reports and events.
  • Expanded Functionality for Reports and Events: The new reports.ts and events.ts modules provide enhanced capabilities. All report tools can now utilize a comprehensive set of filtering options, including issue ID filters for issue-level breakdowns. The listEvents function now supports various filters for reading events, and a pruneThreads helper reduces token usage by filtering irrelevant threads from crash samples.
  • New Type Definitions: A comprehensive types.ts file has been added, defining detailed interfaces and enums for Crashlytics API data structures, including ReportGroup, Issue, Event, Device, OperatingSystem, Note, and various filter types, improving type safety and clarity.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

- Importing interfaces for the Crashlytics public API
- Setting appropriate return types in client responses
- When retrieving native crash sessions, pruning all superfluous threads
  to dramatically reduce token usage.
- Providing schemas for comprehensive filtering options
- Consoldidating report client calls into a single method
- Consolidating tool definitions and sharing schema defs
@maxl0rd maxl0rd force-pushed the ml_crashlytics_tools1 branch from f1504f1 to 3e833e6 Compare September 15, 2025 19:07
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and well-executed refactoring of the Crashlytics tools, improving maintainability, consistency, and functionality. The code is now organized by resource, which is a great improvement. I've identified a critical issue that could lead to a runtime error, along with several medium and high severity issues related to code consistency, correctness, and maintainability. Applying these suggestions will make the new tools more robust and easier to work with.

maxl0rd and others added 6 commits September 15, 2025 15:31
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Comment on lines +53 to +54
queryParams: { updateMask: "state" },
body: { issue: { state } },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body is not correct, there shouldn't be an issue object.

It should be:

      queryParams: { updateMask: "state" },
      body: { state },

// of each report to be more clearly described. In the future, it may be possible
// to consolidate all of these into a single `get_report` tool.

export const get_top_issues = tool(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we call these all list_top_*? Not sure if it matters to the LLM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I elected to use the appropriate API verb for the underlying rpc. It's GET Report and LIST events, etc.

@maxl0rd maxl0rd merged commit d83bc88 into master Sep 16, 2025
60 of 61 checks passed
@maxl0rd maxl0rd deleted the ml_crashlytics_tools1 branch September 16, 2025 13:56
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants