Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_create_permission_target

Define and manage access permissions for resources in the JFrog Platform by creating a new permission target. Specify user and group actions, including READ, WRITE, and MANAGE, for artifacts, builds, and release bundles.

Instructions

Create a new permission target in the JFrog platform

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
created_byNo
modified_byNo
nameYes
resourcesYes

Implementation Reference

  • The handler function for the jfrog_create_permission_target tool. It receives the tool arguments and delegates to the createPermissionTarget helper function.
    handler: async (args: any) => {
      return await createPermissionTarget(args);
    }
  • Core helper function that performs the HTTP POST request to the JFrog Platform's Access API to create a new permission target and validates the response.
    export async function createPermissionTarget(permissionTarget: z.infer<typeof PermissionTargetSchema>) {
      const response = await jfrogRequest("/access/api/v2/permissions", {
        method: "POST",
        body: permissionTarget
      });
      return PermissionTargetSchema.parse(response);
    }
  • Zod schema defining the structure of the permission target object, used for input validation in the tool's inputSchema via zodToJsonSchema.
    const PermissionTargetSchema = z.object({
      name: z.string(),
      resources: z.object({
        artifact: ArtifactResourceSchema.optional(),
        release_bundle: ReleaseBundleResourceSchema.optional(),
        build: BuildResourceSchema.optional()
      }),
      created_by: z.string().optional(),
      modified_by: z.string().optional()
    });
  • Tool object registration defining the name, description, input schema, and handler for jfrog_create_permission_target.
    const createPermissionTargetTool = {
      name: "jfrog_create_permission_target",
      description: "Create a new permission target in the JFrog platform",
      inputSchema: zodToJsonSchema(PermissionTargetSchema),
      //outputSchema: zodToJsonSchema(PermissionTargetSchema),
      handler: async (args: any) => {
        return await createPermissionTarget(args);
      }
    };
  • Export of the PermissionsTools array, which includes the jfrog_create_permission_target tool (at index for createPermissionTargetTool). This array is imported and spread into the main tools list in tools/index.ts.
    export const PermissionsTools = [
      listPermissionTargetsTool,
      getPermissionTargetTool,
      createPermissionTargetTool,
      updatePermissionTargetTool,
      deletePermissionTargetTool,
      getPermissionResourceTool,
      updatePermissionResourceTool,
      replacePermissionResourceTool,
      deletePermissionResourceTool
    ]; 

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jfrog/mcp-jfrog'

If you have feedback or need assistance with the MCP directory API, please join our Discord server