import { defineTool } from "./define-2Lj8Lm1t.js";
import { apiServiceFromContext } from "./api-CkLTFexT.js";

//#region src/tools/whoami.ts
var whoami_default = defineTool({
	name: "whoami",
	description: [
		"Identify the authenticated user in Sentry.",
		"",
		"Use this tool when you need to:",
		"- Get the user's name and email address."
	].join("\n"),
	inputSchema: {},
	requiredScopes: [],
	annotations: {
		readOnlyHint: true,
		openWorldHint: true
	},
	async handler(params, context) {
		const apiService = apiServiceFromContext(context);
		const user = await apiService.getAuthenticatedUser();
		let output = `You are authenticated as ${user.name} (${user.email}).\n\nYour Sentry User ID is ${user.id}.`;
		const constraints = context.constraints;
		if (constraints.organizationSlug || constraints.projectSlug || constraints.regionUrl) {
			output += "\n\n## Session Constraints\n\n";
			if (constraints.organizationSlug) output += `- **Organization**: ${constraints.organizationSlug}\n`;
			if (constraints.projectSlug) output += `- **Project**: ${constraints.projectSlug}\n`;
			if (constraints.regionUrl) output += `- **Region URL**: ${constraints.regionUrl}\n`;
			output += "\nThese constraints limit the scope of this MCP session.";
		}
		return output;
	}
});

//#endregion
export { whoami_default };
//# sourceMappingURL=whoami-Bh_uOPqO.js.map