Skip to content

Add get_labs and join_labs - #77

Merged
shalim786 merged 4 commits into
mainfrom
labs/tools
Oct 12, 2026
Merged

shalim786 merged 4 commits into
mainfrom
labs/tools

Conversation

@shalim786

@shalim786 shalim786 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds get_labs and join_labs to 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.
  • Placed after agent_verify (organization-level tools). Output schema LabsSchema (enabled, enabledAt nullable, available). auth_me, get_labs and join_labs share one NoParams schema.
  • Version 0.12.0 → 0.13.0, like the earlier tool additions.

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_required on purpose: the MCP bridge mints that JWT for any org member, not just admins. get_labs works on both paths.

When the agent should join. get_labs reads enabled: false both for an organization that never joined and for one whose admin left on purpose (docs#311 says so too). So the join_labs description 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 where available is 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_me either), so it's unchanged.

SDK dependency

Merged with agentmail still at ^0.5.37. The bump to ^0.5.44, the first SDK with organizations.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 exact agentmail pin.

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 a get_labs test covers the not-in-Labs answer (enabledAt: null).

🤖 Generated with Claude Code

shalim786 and others added 3 commits October 11, 2026 20:47
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
shalim786 marked this pull request as ready for review October 12, 2026 18:29
@shalim786
shalim786 merged commit 937baed into main Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants