Skip to content

fix: replace bare except and remove unused import#140

Open
ZLeventer wants to merge 2 commits intogoogleanalytics:mainfrom
ZLeventer:fix/code-quality-cleanup
Open

fix: replace bare except and remove unused import#140
ZLeventer wants to merge 2 commits intogoogleanalytics:mainfrom
ZLeventer:fix/code-quality-cleanup

Conversation

@ZLeventer
Copy link
Copy Markdown

Summary

Two minor code quality fixes:

  1. analytics_mcp/tools/utils.py line 33: Replace bare except: with except Exception: in _get_package_version_with_fallback(). A bare except catches SystemExit and KeyboardInterrupt, which should propagate normally — only Exception subclasses (like PackageNotFoundError) should trigger the "unknown" fallback.

  2. analytics_mcp/coordinator.py line 23: Remove unused from json import tool import. This symbol is never referenced in the file.

Test plan

  • Verify _get_package_version_with_fallback() still returns "unknown" when the package metadata is unavailable
  • Verify the MCP server starts and registers tools normally after removing the unused import

…ics#69)

Strip redundant fields (name, parent, property_type) from account and
property summaries to cut token usage for agencies with many GA4
accounts. Add an optional `query` parameter for case-insensitive
display-name filtering so callers can narrow results without
post-processing the full list.
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.

1 participant