import { defineTool } from "./define-2Lj8Lm1t.js";
import { apiServiceFromContext } from "./api-CkLTFexT.js";
import { ParamOrganizationSlug, ParamRegionUrl } from "./schema-rwexXWFL.js";
import { setTag } from "@sentry/core";
import { z } from "zod";

//#region src/tools/create-team.ts
var create_team_default = defineTool({
	name: "create_team",
	requiredScopes: ["team:write"],
	description: [
		"Create a new team in Sentry.",
		"",
		"🔍 USE THIS TOOL WHEN USERS WANT TO:",
		"- 'Create a new team'",
		"- 'Set up a team called [X]'",
		"- 'I need a team for my project'",
		"",
		"Be careful when using this tool!",
		"",
		"<examples>",
		"### Create a new team",
		"```",
		"create_team(organizationSlug='my-organization', name='the-goats')",
		"```",
		"</examples>",
		"",
		"<hints>",
		"- If any parameter is ambiguous, you should clarify with the user what they meant.",
		"</hints>"
	].join("\n"),
	inputSchema: {
		organizationSlug: ParamOrganizationSlug,
		regionUrl: ParamRegionUrl.optional(),
		name: z.string().trim().describe("The name of the team to create.")
	},
	annotations: {
		readOnlyHint: false,
		destructiveHint: false,
		openWorldHint: true
	},
	async handler(params, context) {
		const apiService = apiServiceFromContext(context, { regionUrl: params.regionUrl });
		const organizationSlug = params.organizationSlug;
		setTag("organization.slug", organizationSlug);
		const team = await apiService.createTeam({
			organizationSlug,
			name: params.name
		});
		let output = `# New Team in **${organizationSlug}**\n\n`;
		output += `**ID**: ${team.id}\n`;
		output += `**Slug**: ${team.slug}\n`;
		output += `**Name**: ${team.name}\n`;
		output += "# Using this information\n\n";
		output += `- You should always inform the user of the Team Slug value.\n`;
		return output;
	}
});

//#endregion
export { create_team_default };
//# sourceMappingURL=create-team-BQIns3VD.js.map