MCPcopy
hub / github.com/codeaashu/claude-code / removeMemberByAgentId

Function removeMemberByAgentId

src/utils/swarm/teamHelpers.ts:326–348  ·  view source on GitHub ↗
(
  teamName: string,
  agentId: string,
)

Source from the content-addressed store, hash-verified

324 * @returns true if the member was removed, false if team or member doesn't exist
325 */
326export function removeMemberByAgentId(
327 teamName: string,
328 agentId: string,
329): boolean {
330 const teamFile = readTeamFile(teamName)
331 if (!teamFile) {
332 return false
333 }
334
335 const memberIndex = teamFile.members.findIndex(m => m.agentId === agentId)
336 if (memberIndex === -1) {
337 return false
338 }
339
340 // Remove from members array
341 teamFile.members.splice(memberIndex, 1)
342
343 writeTeamFile(teamName, teamFile)
344 logForDebugging(
345 `[TeammateTool] Removed member ${agentId} from team ${teamName}`,
346 )
347 return true
348}
349
350/**
351 * Sets a team member's permission mode.

Callers 1

killInProcessTeammateFunction · 0.85

Calls 4

readTeamFileFunction · 0.85
writeTeamFileFunction · 0.85
logForDebuggingFunction · 0.85
spliceMethod · 0.80

Tested by

no test coverage detected