Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_get_permission_target

Retrieve detailed information about a specific permission target in the JFrog Platform to manage access control effectively.

Instructions

Get detailed information about a specific permission target

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the permission target to retrieve

Implementation Reference

  • Tool registration object defining the 'jfrog_get_permission_target' tool, including name, description, input schema, and handler function that delegates to getPermissionTarget.
    const getPermissionTargetTool = {
      name: "jfrog_get_permission_target",
      description: "Get detailed information about a specific permission target",
      inputSchema: zodToJsonSchema(z.object({
        name: z.string().describe("The name of the permission target to retrieve")
      })),
      //outputSchema: zodToJsonSchema(PermissionTargetSchema),
      handler: async (args: any) => {
        return await getPermissionTarget(args.name);
      }
    };
  • The tool's handler function which executes the logic by calling getPermissionTarget with the provided name argument.
    handler: async (args: any) => {
      return await getPermissionTarget(args.name);
    }
  • Core helper function that makes the HTTP GET request to the JFrog API to fetch the permission target details and parses the response using PermissionTargetSchema.
    export async function getPermissionTarget(name: string) {
      const response = await jfrogRequest(`/access/api/v2/permissions/${name}`, {
        method: "GET",
      });
      return PermissionTargetSchema.parse(response);
    }
  • Zod schema for validating the structure of a PermissionTarget object, used to parse the API response in getPermissionTarget.
    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()
    });
  • Input schema for the tool, defining the required 'name' parameter converted to JSON schema for MCP.
    inputSchema: zodToJsonSchema(z.object({
      name: z.string().describe("The name of the permission target to retrieve")
    })),
  • Local array registering multiple permission-related tools, including getPermissionTargetTool, exported for inclusion in main tools list.
    export const PermissionsTools = [
      listPermissionTargetsTool,
      getPermissionTargetTool,
      createPermissionTargetTool,
      updatePermissionTargetTool,
      deletePermissionTargetTool,
      getPermissionResourceTool,
      updatePermissionResourceTool,
      replacePermissionResourceTool,
      deletePermissionResourceTool
    ]; 
  • tools/index.ts:13-23 (registration)
    Main tools export array that spreads PermissionsTools, thereby registering jfrog_get_permission_target among all available tools.
    export const tools =[
      ...RepositoryTools,
      ...BuildsTools,
      ...RuntimeTools,
      ...AccessTools,
      ...AQLTools,
      ...CatalogTools,
      ...CurationTools,
      ...PermissionsTools,
      ...ArtifactSecurityTools,
    ];

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