Fix repeated field serialization, add Keyword Planner tool, and add update instructions#48
Conversation
format_output_value() only handled proto.Enum types, causing "Unable to serialize unknown type: RepeatedScalarContainer" errors when querying fields like ad.final_urls, ad.responsive_search_ad.headlines, or any protobuf Message field. Added handling for: - RepeatedScalarContainer (e.g. final_urls) → list - RepeatedCompositeContainer (e.g. headlines) → list of dicts - protobuf Message types (e.g. Money) → dict via MessageToDict Also added update instructions to README. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Adds a new MCP tool that wraps the Google Ads KeywordPlanIdeaService to generate keyword ideas with search volume, competition data, and bid estimates. Supports seed keywords and/or page URL, language and geo targeting, and configurable result limits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I already fixed repeated field serialization and we won't adding support for keyword planning now, so I'd like to only merge the update instructions. Can you please send another PR just with that, or update this one? Thanks! 🙏 |
ZLeventer
left a comment
There was a problem hiding this comment.
The Keyword Planner tool addition is valuable — keyword research is one of the most common Google Ads workflows and having it in the MCP server makes the tool significantly more useful for SEO/SEM practitioners.
A few observations on the implementation:
-
Seed validation — Good that it requires at least one of
keywordsorpage_url. Thekeyword_and_url_seedbranch for when both are provided is correct per the API spec. -
Geo and language defaults — US/English as defaults makes sense. The docstring listing common geo/language IDs is a nice touch for discoverability.
-
Monthly volumes — Limiting to
[-12:]is smart to keep response sizes reasonable. -
The
limitparameter — Works but note thatKeywordPlanIdeaServicereturns results server-side in batches. If pagination is needed for larger result sets, thepage_tokenfrom the response would need to be handled. For a default of 50 this is fine.
The update instructions in README.md are also a useful addition — the "how do I update" question comes up constantly with MCP servers.
Summary
format_output_value()to handle repeated and message protobuf field types that previously caused"Unable to serialize unknown type: RepeatedScalarContainer"errors when querying fields likead.final_urls,ad.responsive_search_ad.headlines, or any protobuf Message fieldgenerate_keyword_ideas) — wraps theKeywordPlanIdeaServiceto generate keyword ideas with search volume, competition data, and bid estimates. Supports seed keywords and/or page URL, language/geo targeting, and configurable result limitsTest plan
ad_group_ad.ad.final_urlsvia the MCP search tool and confirm it returns a JSON list instead of erroringgenerate_keyword_ideaswith seed keywords and confirm results include search volume and competition data🤖 Generated with Claude Code