jfrog_create_local_repository
Set up a local repository in JFrog Artifactory with specific configurations, including package type, project key, and assigned environments, for efficient artifact management.
Instructions
Create a new local repository in artifactroy
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Repository description | |
| environments | No | Environments to assign the repository to | |
| key | Yes | the key of the repository | |
| packageType | Yes | Package type of the repository | |
| projectKey | No | Project key to assign the repository to | |
| rclass | Yes | The repository type |
Implementation Reference
- tools/repositories.ts:28-36 (handler)The core handler function that executes the JFrog Artifactory API call to create a local repository via PUT request to `/artifactory/api/repositories/{key}` with the provided options.export async function createLocalRepository(options: CreateLocalRepositoryOptions) { console.error("Starting createLocalRepository"); const response = await jfrogRequest(`/artifactory/api/repositories/${options.key}`, { method: "PUT", body: options }); return JFrogRepositoryCreateResponseSchema.parse(response); }
- schemas/repositories.ts:10-23 (schema)Zod schemas defining the input structure for creating a local repository: BaseRepositorySchema provides common fields, extended by CreateLocalRepoSchema which fixes rclass to 'local'.export const BaseRepositorySchema = z.object({ key: z.string().describe("the key of the repository"), rclass: z.enum([ "local", "remote", "virtual", "federated" ]).describe("The repository type"), packageType: PackageTypeEnum, projectKey: z.string().optional().describe("Project key to assign the repository to"), environments: z.array(z.string()).optional().describe("Environments to assign the repository to"), description: z.string().optional().describe("Repository description") }); export const CreateLocalRepoSchema = BaseRepositorySchema.extend({ rclass: z.literal("local").describe("The repository type") });
- tools/repositories.ts:124-133 (registration)Tool registration object defining the 'jfrog_create_local_repository' tool, including name, description, input schema, and handler that parses args and delegates to createLocalRepository.const createLocalRepositoryTool = { name: "jfrog_create_local_repository", description: "Create a new local repository in artifactroy", inputSchema: zodToJsonSchema(CreateLocalRepoSchema), //outputSchema: zodToJsonSchema(JFrogRepositoryCreateResponseSchema), handler: async (args: any) => { const parsedArgs = CreateLocalRepoSchema.parse(args); return await createLocalRepository(parsedArgs); } };
- tools/repositories.ts:168-175 (registration)Export of RepositoryTools array that includes the createLocalRepositoryTool for use in the main tools list.export const RepositoryTools =[ checkJfrogAvailabilityTool, createLocalRepositoryTool, createRemoteRepositoryTool, createVirtualRepositoryTool, setFolderPropertyTool, listRepositoriesTool ];
- tools/index.ts:13-23 (registration)Global tools array registration where RepositoryTools (containing jfrog_create_local_repository) is spread into the main exported tools list.export const tools =[ ...RepositoryTools, ...BuildsTools, ...RuntimeTools, ...AccessTools, ...AQLTools, ...CatalogTools, ...CurationTools, ...PermissionsTools, ...ArtifactSecurityTools, ];