create_repository
Create a new repository in a Bitbucket Cloud workspace with configurable settings for privacy, language, issue tracking, and project assignment.
Instructions
Create a new repository in the specified workspace.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| name | No | Repository name | |
| description | No | Repository description | |
| is_private | No | Whether the repository is private | |
| language | No | Primary language | |
| has_issues | No | Enable issue tracker | |
| has_wiki | No | Enable wiki | |
| project_key | No | Project key to add repo to |
Implementation Reference
- src/api/repositories.ts:35-38 (handler)Core handler function that executes the repository creation by making a POST request to the Bitbucket API endpoint.async create(params: CreateRepositoryParams): Promise<BitbucketRepository> { const { workspace, repo_slug, ...body } = params; return this.client.post<BitbucketRepository>(`/repositories/${workspace}/${repo_slug}`, body); }
- src/tools/index.ts:912-914 (handler)Dispatch handler in ToolHandler that validates input with Zod schema and delegates to RepositoriesAPI.create method.case 'create_repository': { const params = toolSchemas.create_repository.parse(args); return this.repos.create(params);
- src/tools/index.ts:28-38 (schema)Zod schema definition for validating create_repository tool parameters.create_repository: z.object({ workspace: z.string().describe('The workspace slug'), repo_slug: z.string().describe('The repository slug'), name: z.string().optional().describe('Repository name'), description: z.string().optional().describe('Repository description'), is_private: z.boolean().optional().describe('Whether the repository is private'), language: z.string().optional().describe('Primary language'), has_issues: z.boolean().optional().describe('Enable issue tracker'), has_wiki: z.boolean().optional().describe('Enable wiki'), project_key: z.string().optional().describe('Project key to add repo to'), }),
- src/tools/index.ts:342-360 (registration)MCP tool registration in toolDefinitions array, defining name, description, and input schema for the LLM.{ name: 'create_repository', description: 'Create a new repository in the specified workspace.', inputSchema: { type: 'object' as const, properties: { workspace: { type: 'string', description: 'The workspace slug' }, repo_slug: { type: 'string', description: 'The repository slug' }, name: { type: 'string', description: 'Repository name' }, description: { type: 'string', description: 'Repository description' }, is_private: { type: 'boolean', description: 'Whether the repository is private' }, language: { type: 'string', description: 'Primary language' }, has_issues: { type: 'boolean', description: 'Enable issue tracker' }, has_wiki: { type: 'boolean', description: 'Enable wiki' }, project_key: { type: 'string', description: 'Project key to add repo to' }, }, required: ['workspace', 'repo_slug'], }, },
- src/types/index.ts:273-283 (schema)TypeScript interface defining the parameters for create_repository.export interface CreateRepositoryParams { workspace: string; repo_slug: string; name?: string; description?: string; is_private?: boolean; language?: string; has_issues?: boolean; has_wiki?: boolean; project_key?: string; }