Repository navigation
feat(mcp): ChatGPT plugin lists the 40 most used reads (wave 1) with least-privilege scopes - #120
Merged
Merged
Conversation
…ave 1) /chatgpt now registers 40 generated tools next to its 13 hand-shaped ones: the most used reads over the last 30 days (REST plus /mcp calls) from inbox, comments, mentions, reviews, account health, analytics and profiles. Each declares its OAuth scope (securitySchemes) from the spec's x-oauth-scopes and a one-paragraph description; no search_tools/call_tool. The 13 live definitions are unchanged and pinned by a fixture. - Generator: explicit hints with read-only overrides for POST queries, openWorldHint on public-content reads, TOOL_OAUTH_SCOPE table. - /chatgpt advertises messaging:write (the inbox scope) on top of its 4. - A link without a tool's scope gets the mcp/www_authenticate insufficient_scope challenge, so ChatGPT asks to re-link; the token's scope comes from /v1/auth/verify and is cached with the user id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
…d ads and contacts reads Schedule-Posts-API #10145 adds read-only ads:read, contacts:read and messaging:read. Reads now declare them (TOOL_OAUTH_SCOPES keeps every scope that reaches a tool, the declared one first), so /chatgpt advertises messaging:read, ads:read and contacts:read instead of messaging:write. Wave 1 is re-ranked over every readable group: ads and contacts reads in the top 40 replace the tail of the old list. The re-link challenge fires only when the token holds none of a tool's scopes, so a :write scope still covers the read. Argument lines in descriptions are capped at 100 chars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
- The generator refuses a spec with no x-oauth-scopes instead of emptying the scope table, and a listed tool without a scope fails with its name. - Pin the server instructions; test a generated tool's success path and the scope claim read from the verified token. - Descriptions keep arguments documented by name only and no longer put a blank line after "Args:". - A cache hit also keeps the token's identity (user id, scope) fresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
…scopes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y
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.
Why
The ChatGPT plugin (
/chatgpt, published, ~1,700 users a week) only lists its 13 hand-shaped posting and analytics tools. OpenAI now picks up new tools on a published plugin after a daily or on-demand scan, each tool reviewed on its own, so the plugin can grow without a resubmission. Miki asked for the most used tools first, a curated set (about 150 in all, not the ~1,400 /mcp serves), in waves, with least privilege.What
chatgpt_tools.py: wave 1, the 40 most used reads over 30 days (REST requests plus /mcp tool calls): inbox, comments, reviews, account health, analytics, profiles, ads (campaigns, ads, insights, tree) and contacts/leads. Each declares its read scope (securitySchemes) and gets a short description (one paragraph, one line per argument). Nosearch_tools/call_tool. 53 tools, ~25k tokens of tools/list (7.4k for the live 13)./chatgptadvertisesmessaging:read,ads:read,contacts:readon top of its 4 scopes; no write scope for those groups.openWorldHintfor 7 public-content reads) andTOOL_OAUTH_SCOPES(every scope that reaches a tool, from the spec'sx-oauth-scopes, the declared one first).openapi.yamlcarries them until the next regenerate.MissingScopeChallengeMiddleware: a link without any of a tool's scopes gets themcp/www_authenticateinsufficient_scopechallenge, so ChatGPT asks to re-link. A 403 the token's scopes already cover (team member with the group off) stays a plain error. The token's scope comes from/v1/auth/verify, cached with the user id.OAUTH_SCOPESgains the 3 read scopes (mirrors the authorization server).tests/fixtures/chatgpt_live_tools.json.Follow-ups
test_metadata_scopes_match_the_live_authorization_serverchecks the live server's scopes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kx4ZnYRCwTShnKwf5bar5Y