const require_chunk = require('./chunk-DWy1uDak.cjs');
const require_define = require('./define-BfP4rFlE.cjs');
const require_api = require('./api-CZD9zwQ-.cjs');
const require_schema = require('./schema-Cv_VNAHz.cjs');
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
const zod = require_chunk.__toESM(require("zod"));

//#region src/tools/create-dsn.ts
var create_dsn_default = require_define.defineTool({
	name: "create_dsn",
	requiredScopes: ["project:write"],
	description: [
		"Create an additional DSN for an EXISTING project.",
		"",
		"🔍 USE THIS TOOL WHEN:",
		"- Project already exists and needs additional DSN",
		"- 'Create another DSN for project X'",
		"- 'I need a production DSN for existing project'",
		"",
		"❌ DO NOT USE for new projects (use create_project instead)",
		"",
		"Be careful when using this tool!",
		"",
		"<examples>",
		"### Create additional DSN for existing project",
		"```",
		"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')",
		"```",
		"</examples>",
		"",
		"<hints>",
		"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.",
		"- If any parameter is ambiguous, you should clarify with the user what they meant.",
		"</hints>"
	].join("\n"),
	inputSchema: {
		organizationSlug: require_schema.ParamOrganizationSlug,
		regionUrl: require_schema.ParamRegionUrl.optional(),
		projectSlug: require_schema.ParamProjectSlug,
		name: zod.z.string().trim().describe("The name of the DSN to create, for example 'Production'.")
	},
	annotations: {
		readOnlyHint: false,
		destructiveHint: false,
		openWorldHint: true
	},
	async handler(params, context) {
		const apiService = require_api.apiServiceFromContext(context, { regionUrl: params.regionUrl });
		const organizationSlug = params.organizationSlug;
		(0, __sentry_core.setTag)("organization.slug", organizationSlug);
		(0, __sentry_core.setTag)("project.slug", params.projectSlug);
		const clientKey = await apiService.createClientKey({
			organizationSlug,
			projectSlug: params.projectSlug,
			name: params.name
		});
		let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\n\n`;
		output += `**DSN**: ${clientKey.dsn.public}\n`;
		output += `**Name**: ${clientKey.name}\n\n`;
		output += "# Using this information\n\n";
		output += "- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\n";
		return output;
	}
});

//#endregion
Object.defineProperty(exports, 'create_dsn_default', {
  enumerable: true,
  get: function () {
    return create_dsn_default;
  }
});
//# sourceMappingURL=create-dsn-ggGt0lZf.cjs.map