delete_team
Delete a team by providing its UUID to permanently remove it from Umami Analytics.
Instructions
Delete a team
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamId | Yes | Team UUID to delete |
Implementation Reference
- src/tools/teams.ts:63-73 (handler)The 'delete_team' tool handler that takes a teamId, calls DELETE /api/teams/{teamId} via the UmamiClient, and returns a success text message.
server.tool( "delete_team", "Delete a team", { teamId: z.string().describe("Team UUID to delete"), }, async ({ teamId }) => { await client.call("DELETE", `/api/teams/${teamId}`); return { content: [{ type: "text", text: `Team ${teamId} deleted successfully.` }] }; } ); - src/tools/teams.ts:63-73 (schema)The input schema for 'delete_team' defines a required 'teamId' (string, described as Team UUID). No return schema is defined separately; the handler always returns text content.
server.tool( "delete_team", "Delete a team", { teamId: z.string().describe("Team UUID to delete"), }, async ({ teamId }) => { await client.call("DELETE", `/api/teams/${teamId}`); return { content: [{ type: "text", text: `Team ${teamId} deleted successfully.` }] }; } ); - src/tools/teams.ts:5-5 (registration)The 'delete_team' tool is registered via server.tool() inside the registerTeamTools function (line 5), which is called from src/index.ts:35.
export function registerTeamTools(server: McpServer, client: UmamiClient) { - src/index.ts:35-35 (registration)Registration call: registerTeamTools(server, client) is invoked in the main index.ts to register all team tools including 'delete_team'.
registerTeamTools(server, client); - src/client.ts:68-100 (helper)The UmamiClient.call() method used by the handler to make the HTTP DELETE request to the Umami API.
async call( method: string, path: string, body?: Record<string, unknown>, query?: Record<string, string | number | boolean | undefined> ): Promise<unknown> { this.ensureConfigured(); const token = await this.getToken(); let url = `${this.config.baseUrl}${path}`; if (query) { const params = new URLSearchParams(); for (const [k, v] of Object.entries(query)) { if (v !== undefined && v !== null && v !== "") { params.set(k, String(v)); } } const qs = params.toString(); if (qs) url += `?${qs}`; } const headers: Record<string, string> = { Authorization: `Bearer ${token}`, }; if (body) { headers["Content-Type"] = "application/json"; } const res = await fetch(url, { method, headers, body: body ? JSON.stringify(body) : undefined,