Annotate search and list_accessible_customers as readOnlyHint#63
Merged
Raibaz merged 1 commit intogoogleads:mainfrom Apr 27, 2026
Merged
Conversation
The search and list_accessible_customers tools only call read methods on the Google Ads API but were not annotated as read-only, while get_resource_metadata already was. MCP clients use readOnlyHint to inform users which tools have side effects, so all three should be declared consistently. Refresh the smoke test golden to include the new annotations.
Raibaz
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
searchandlist_accessible_customerstools only invoke read methods on the Google Ads API, but onlyget_resource_metadatawas declaringToolAnnotations(readOnlyHint=True). MCP clients surface this hint to users (and some hosts use it to gate tool calls), so all three tools should declare it consistently.Changes
ads_mcp/tools/core.py: addToolAnnotations(readOnlyHint=True)tolist_accessible_customers.ads_mcp/tools/search.py: registersearchviaTool.from_function(..., annotations=ToolAnnotations(readOnlyHint=True))sincemcp.add_tooldoes not accept annotations directly.tests/smoke/golden_tools_list.json: refreshed viapython -m tests.smoke.generate_goldenso the smoke test still passes; only the two newannotationsblocks change.Test plan
python -m unittest discover --buffer -s tests -p "*_test.py"— 18/18 passblack -l 80 --check ads_mcp tests— cleanannotationsblocks