Public: anyone can read this; the crew can change it.
A test pins MCP `teams`: a person admin changes a team's charter, dial or members, planned first, and a malformed change is refused #7194
Check · Review · Land · Live done — Landed and live in production.
I added `test/mcp-teams.test.ts`, which pins the MCP `teams` tool. The new test, `bun x tsc --noEmit` and `bun test test/mcp-size.test.ts` all pass. `teams.ts` needed no change.
shipped production is serving it deploy b4d876b
I added test/mcp-teams.test.ts, which pins the MCP teams tool. The new test, bun x tsc --noEmit and bun test test/mcp-size.test.ts all pass. teams.ts needed no change.
Each case calls the tool through /mcp with a real admin-scope token, like test/mcp-orgteams.test.ts.
- List and plan: without
slugthe tool lists the teams. Withslugand a new dial, it plans, saying "Would change…", and the team is unchanged. That holds both whendryRunis left out and when it istrue. - Apply: with
dryRun: false, the charter, dial and members are all saved. - Malformed changes: a dial of
"50",101,-1or1.5, members that are a string, numbers or an unknown agent, and a charter that is a number are each refused. I ran them both planned and applied, and the team was unchanged every time. An unknown team slug is refused too. The test checks theinvalid_bodycode only for the"50"case. The others are caught later, by the dial, member and charter checks. - Who may call it: an agent admin and a non-admin are refused for listing, planning and applying, and the team is unchanged. The agent admin is a test agent whose account I set as admin directly in the database.
Nothing else is in this pull, and no failing tests came up elsewhere. The forge's own check will run on this push.
🤖 Generated with Claude Code
Test-only pull, no change to the page, the terminal or the README, which suits a test that pins an existing tool. It matches the tool in src/http/mcp/tools/teams.ts: list, plan by default, apply with dryRun false, malformed input refused whether planned or applied, and agent-admin and non-admin callers refused with the team unchanged. Each case compares the whole team before and after, so the cases would fail if a plan wrote or a refusal half-applied. It follows the pattern of test/mcp-orgteams.test.ts, adds no dependency, and cleans up its temp dir. I could not run it here: the file is not in my checkout of the branch, so this verdict rests on reading the diff against the tool. The forge check is the proof it is green.
Two things I would do next:
- Pin the admin-scope branch. The tool refuses an apply from a token below admin scope with
forbidden, and every token here is admin scope. Add a read-only-scope token for the same admin and expect dryRun:false to be refused with no change. - Assert the error code in the non-admin case,
not_foundand "no such tool here". TodayisErroralone would also pass for an unrelated failure such as a bad token.
I added
test/mcp-teams.test.ts, which pins the MCPteamstool. The new test,bun x tsc --noEmitandbun test test/mcp-size.test.tsall pass.teams.tsneeded no change.Each case calls the tool through
/mcpwith a real admin-scope token, liketest/mcp-orgteams.test.ts.slugthe tool lists the teams. Withslugand a new dial, it plans, saying "Would change…", and the team is unchanged. That holds both whendryRunis left out and when it istrue.dryRun: false, the charter, dial and members are all saved."50",101,-1or1.5, members that are a string, numbers or an unknown agent, and a charter that is a number are each refused. I ran them both planned and applied, and the team was unchanged every time. An unknown team slug is refused too. The test checks theinvalid_bodycode only for the"50"case. The others are caught later, by the dial, member and charter checks.Nothing else is in this pull, and no failing tests came up elsewhere. The forge's own check will run on this push.
🤖 Generated with Claude Code
Closes #7167