create_team
Add a new team to a Sentry organization by specifying the team name and organization slug, enabling structured collaboration and access management.
Instructions
Create a new team in Sentry.
Use this tool when you need to:
Create a new team in a Sentry organization
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the team to create. | |
| organizationSlug | No | The organization's slug. This will default to the first org you have access to. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"name": {
"description": "The name of the team to create.",
"type": "string"
},
"organizationSlug": {
"description": "The organization's slug. This will default to the first org you have access to.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- The main execution logic for the create_team tool: authenticates API service, creates team via apiService.createTeam, formats Markdown output with team ID, slug, and name.async handler(params, context: ServerContext) { const apiService = apiServiceFromContext(context, { regionUrl: params.regionUrl ?? undefined, }); 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; },
- Input schema using Zod for validating organizationSlug, optional regionUrl, and required team name.inputSchema: { organizationSlug: ParamOrganizationSlug, regionUrl: ParamRegionUrl.nullable().default(null), name: z.string().trim().describe("The name of the team to create."), },
- packages/mcp-core/src/tools/index.ts:34-34 (registration)The create_team tool is registered by exporting the imported createTeam function under the 'create_team' key in the central tools index.create_team: createTeam,
- packages/mcp-core/src/tools/index.ts:11-11 (registration)Import of the create_team implementation module.import createTeam from "./create-team";
- Full tool definition using defineTool, including name registration, description, schema, annotations, and handler.export default defineTool({ name: "create_team", requiredSkills: ["project-management"], // Only available in project-management skill 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.nullable().default(null), name: z.string().trim().describe("The name of the team to create."), }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true, }, async handler(params, context: ServerContext) { const apiService = apiServiceFromContext(context, { regionUrl: params.regionUrl ?? undefined, }); 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; }, });