fix(mcp): claim_token renders real ClaimResponse + sends canonical token#35
Merged
Merged
Conversation
…oken`
The claim_token tool was rendering fields from the retired 201 direct-claim
shape ({resource_type, token, tier, status, name}) that the api stopped
returning on 2026-05-20. Every successful claim printed "(see list_resources)"
four times — the agent learned NOTHING about what just happened and never
surfaced the 24h session_token the api hands back for immediate use.
Now mirrors the live ClaimResponse shape (api/openapi.snapshot.json):
{ok, team_id, user_id, session_token?, message?}. Branches into a
"session token ready to use" block (legacy direct-claim path) vs a
"magic link sent, check inbox" block depending on whether session_token
came back, so the agent has actionable next-step copy in both cases.
Wire body also flips from {jwt, email} → {token, email}. `jwt` is marked
deprecated in the openapi ClaimRequest schema; the api still accepts it
(`token` wins on collision) but the MCP was the last drift source the
ClaimRequest doc explicitly called out (dashboard + sdk-go already moved).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
claim_tokentool was rendering fields from the retired 201 direct-claim shape ({resource_type, token, tier, status, name}) that the api stopped returning on 2026-05-20. Every successful claim printed(see list_resources)four times — the agent learned NOTHING about what just happened, and never surfaced the 24hsession_tokenthe api hands back for immediate use.ClaimResponseshape (api/openapi.snapshot.json):{ok, team_id, user_id, session_token?, message?}. Branches into a "session token ready to use" block (legacy direct-claim path) vs a "magic link sent, check inbox" block depending on whethersession_tokencame back, so the agent has actionable next-step copy in both cases.{jwt, email}→{token, email}.jwtisdeprecated: truein the openapiClaimRequestschema (api still accepts it —tokenwins on collision — but the MCP was the last named drift source theClaimRequestdoc explicitly called out; dashboard + sdk-go already moved).Coverage block
Test plan
npm test— 373 passing, 0 failingnpm run build— tsc clean