jfrog_set_folder_property
Define custom properties for a folder in Artifactory, with optional recursive application to sub-folders. Use this tool to organize and manage folder metadata effectively.
Instructions
Set properties on a folder in Artifactory, with optional recursive application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folderPath | Yes | Path to the folder where properties should be set | |
| properties | Yes | Key-value pairs of properties to set | |
| recursive | No | Whether to apply properties recursively to sub-folders |
Implementation Reference
- tools/repositories.ts:38-51 (handler)Core handler function implementing the API logic to set properties on an Artifactory folder using PUT /api/storage/{path} with properties and recursive query parameters.export async function setFolderProperty(folderPath: string, properties: Record<string, string>, recursive = false) { // Convert properties object to query string format const propsQuery = Object.entries(properties) .map(([key, value]) => `${key}=${value}`) .join(";"); const url = `/artifactory/api/storage/${folderPath}?properties=${propsQuery}&recursive=${recursive ? 1 : 0}`; const response = await jfrogRequest(url, { method: "PUT" }); return response; }
- schemas/repositories.ts:75-79 (schema)Zod schema for tool input validation: folderPath (string), properties (record<string, string>), recursive (boolean, default false).export const SetFolderPropertySchema = z.object({ folderPath: z.string().describe("Path to the folder where properties should be set"), properties: z.record(z.string()).describe("Key-value pairs of properties to set"), recursive: z.boolean().default(false).describe("Whether to apply properties recursively to sub-folders") });
- tools/repositories.ts:113-122 (registration)Tool definition object registering 'jfrog_set_folder_property' with name, description, input schema, and handler that validates args and delegates to setFolderProperty.const setFolderPropertyTool = { name: "jfrog_set_folder_property", description: "Set properties on a folder in Artifactory, with optional recursive application", inputSchema: zodToJsonSchema(SetFolderPropertySchema), //outputSchema: zodToJsonSchema(z.object({})), handler: async (args: any) => { const parsedArgs = SetFolderPropertySchema.parse(args); return await setFolderProperty(parsedArgs.folderPath, parsedArgs.properties, parsedArgs.recursive); } };
- tools/repositories.ts:168-175 (registration)Registers the jfrog_set_folder_property tool (as setFolderPropertyTool) within the RepositoryTools array.export const RepositoryTools =[ checkJfrogAvailabilityTool, createLocalRepositoryTool, createRemoteRepositoryTool, createVirtualRepositoryTool, setFolderPropertyTool, listRepositoriesTool ];
- tools/index.ts:13-23 (registration)Main tools registry includes RepositoryTools (spreading all repository tools including jfrog_set_folder_property).export const tools =[ ...RepositoryTools, ...BuildsTools, ...RuntimeTools, ...AccessTools, ...AQLTools, ...CatalogTools, ...CurationTools, ...PermissionsTools, ...ArtifactSecurityTools, ];