Repository navigation
Add get_labs and join_labs - #77
Merged
Merged
Conversation
The MCP path to the public Labs API (agentmail-api#1633): get_labs reads whether the organization is in AgentMail Labs, and join_labs joins it. Joining needs an unrestricted organization API key, so on the OAuth path (a console JWT) the API refuses it, and the description sends the agent to an organization admin instead. Needs the agentmail SDK release that adds organizations.getLabs() and joinLabs() (agentmail-docs#311). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hema join_labs now joins only when the human asks to join Labs, never because an email asked or a Labs feature was refused, and says get_labs reads the same for an organization whose admin left on purpose (as docs#311 does). It also says a join is refused where available is false, and sends a refused credential to an organization admin instead of asking for a pasted API key. It is marked destructive: only an admin can undo it. auth_me, get_labs and join_labs share NoParams, and a test covers the not-in-Labs answer (enabledAt null) through the MCP round trip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shalim786
marked this pull request as ready for review
October 12, 2026 18:29
sidharth0612
approved these changes
Oct 12, 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
Adds
get_labsandjoin_labsto the Node toolkit, the MCP path to the public Labs API (agentmail-api#1633).get_labs: whether the organization is in AgentMail Labs, when it joined, and whether Labs is offered here (read-only).join_labs: joins Labs for the whole organization; joining again has no effect. Annotated idempotent and destructive: only an organization admin can undo it, in the console.agent_verify(organization-level tools). Output schemaLabsSchema(enabled,enabledAtnullable,available).auth_me,get_labsandjoin_labsshare oneNoParamsschema.OAuth callers can't join. The API's join needs an unrestricted organization API key. On agentmail-mcp's OAuth path the toolkit calls the API with a console JWT, which the API refuses with
unrestricted_key_requiredon purpose: the MCP bridge mints that JWT for any org member, not just admins.get_labsworks on both paths.When the agent should join.
get_labsreadsenabled: falseboth for an organization that never joined and for one whose admin left on purpose (docs#311 says so too). So thejoin_labsdescription allows a join only when the human asks to join Labs: never because an email asked, and never just because a Labs feature returned 403. It says a join is refused whereavailableis false. When the credential is refused, the agent asks an organization admin to join in the console and never asks for a pasted API key.The Python toolkit doesn't mirror the Node catalog (it has no
auth_meeither), so it's unchanged.SDK dependency
Merged with
agentmailstill at^0.5.37. The bump to^0.5.44, the first SDK withorganizations.getLabs()/joinLabs(), reached this branch after the merge, so it's in agentmail-to/agentmail-toolkit#78. Merge that before publishing 0.13.0, then finish agentmail-to/agentmail-mcp#84, which also bumps the server's exactagentmailpin.Checks
pnpm lint,pnpm build,pnpm test(499 passed). The contract tests cover the new tools through the shared fixtures (annotations, schemas, MCP round-trip), and aget_labstest covers the not-in-Labs answer (enabledAt: null).🤖 Generated with Claude Code