Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_list_permission_targets

Retrieve a list of all permission targets in the JFrog platform, enabling pagination and result limits for efficient access management.

Instructions

Get a list of all permission targets in the JFrog platform

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for pagination
limitNoLimit the number of results

Implementation Reference

  • Local registration of the jfrog_list_permission_targets tool (as listPermissionTargetsTool) in the PermissionsTools array, which is exported for further registration.
    export const PermissionsTools = [
      listPermissionTargetsTool,
      getPermissionTargetTool,
      createPermissionTargetTool,
      updatePermissionTargetTool,
      deletePermissionTargetTool,
      getPermissionResourceTool,
      updatePermissionResourceTool,
      replacePermissionResourceTool,
      deletePermissionResourceTool
  • tools/index.ts:13-23 (registration)
    Global registration where PermissionsTools is spread into the main tools array, making jfrog_list_permission_targets available.
    export const tools =[
      ...RepositoryTools,
      ...BuildsTools,
      ...RuntimeTools,
      ...AccessTools,
      ...AQLTools,
      ...CatalogTools,
      ...CurationTools,
      ...PermissionsTools,
      ...ArtifactSecurityTools,
    ];
  • Full tool definition including the handler function that executes the tool logic by calling getAllPermissionTargets.
    const listPermissionTargetsTool = {
      name: "jfrog_list_permission_targets",
      description: "Get a list of all permission targets in the JFrog platform",
      inputSchema: zodToJsonSchema(z.object({
        cursor: z.string().optional().describe("Cursor for pagination"),
        limit: z.number().optional().describe("Limit the number of results")
      })),
      //outputSchema: zodToJsonSchema(PermissionListSchema),
      handler: async (args: any) => {
        return await getAllPermissionTargets(args.cursor, args.limit);
      }
    };
  • Core helper function called by the tool handler to fetch permission targets via JFrog API and parse response.
    export async function getAllPermissionTargets(cursor?: string, limit?: number) {
      const params = new URLSearchParams();
      if (cursor) params.append("cursor", cursor);
      if (limit) params.append("limit", limit.toString());
      
      const response = await jfrogRequest(`/access/api/v2/permissions${params.toString() ? `?${params.toString()}` : ""}`, {
        method: "GET",
      });
      return PermissionListSchema.parse(response);
    }
  • Zod schema for parsing the output of list permission targets API response.
    const PermissionListSchema = z.object({
      permissions: z.array(z.object({
        name: z.string(),
        uri: z.string()
      })),
      cursor: z.string().optional()
    });

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