Skip to content

Correct misleading scope comment and constant name in utils#64

Merged
Raibaz merged 1 commit intogoogleads:mainfrom
ZLeventer:fix/utils-scope-docstring
Apr 27, 2026
Merged

Correct misleading scope comment and constant name in utils#64
Raibaz merged 1 commit intogoogleads:mainfrom
ZLeventer:fix/utils-scope-docstring

Conversation

@ZLeventer
Copy link
Copy Markdown
Contributor

Summary

The comment above the private OAuth scope constant in ads_mcp/utils.py describes it as the scope for the Analytics Admin and Analytics Data APIs, but the value is in fact the Google Ads scope (`https://www.googleapis.com/auth/adwords\`). It also labels the scope read-only — Google Ads does not publish a separate read-only variant; the server is read-only because of the tools it exposes, not the scope.

Changes

  • Replace the comment with an accurate description.
  • Rename `_READ_ONLY_ADS_SCOPE` → `_ADS_SCOPE`.
  • Tighten the docstring on `_create_credentials` to match.

No behavior changes — the scope value is unchanged.

Test plan

  • `python -m unittest discover --buffer -s tests -p "*_test.py"` — 18/18 pass
  • `black -l 80 --check ads_mcp tests` — clean
  • `grep -rn _READ_ONLY_ADS_SCOPE` — no remaining references

The comment described the Google Ads OAuth scope as belonging to the
Analytics Admin and Analytics Data APIs, and called it 'read-only'.
The scope (https://www.googleapis.com/auth/adwords) is the Google Ads
scope, and Google Ads does not publish a separate read-only variant —
read-only behavior comes from the tools this server exposes, not the
scope itself.

Rename the private constant from _READ_ONLY_ADS_SCOPE to _ADS_SCOPE,
update the docstring on _create_credentials accordingly, and replace
the comment with an accurate description.
@Raibaz Raibaz merged commit b6aee49 into googleads:main Apr 27, 2026
8 checks passed
@ZLeventer ZLeventer deleted the fix/utils-scope-docstring branch April 28, 2026 02:35
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.

2 participants