jfrog_check_availability
Verify the operational status of the JFrog platform to ensure it is ready and functioning correctly.
Instructions
Check if JFrog platform is ready and functioning or not
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/repositories.ts:18-24 (handler)Core implementation of the JFrog platform availability check: sends GET request to /artifactory/api/v1/system/readiness and parses response with schema.
export async function checkPlatformReadiness() { const response = await jfrogRequest("/artifactory/api/v1/system/readiness", { method: "GET", }); return JFrogPlatformReadinessSchema.parse(response); } - tools/repositories.ts:103-111 (registration)Tool registration object defining name, description, input schema (empty), and thin handler wrapper calling checkPlatformReadiness.
const checkJfrogAvailabilityTool = { name: "jfrog_check_availability", description: "Check if JFrog platform is ready and functioning or not", inputSchema: zodToJsonSchema(z.object({})), //outputSchema: zodToJsonSchema(JFrogPlatformReadinessSchema), handler: async () => { return await checkPlatformReadiness(); } }; - schemas/repositories.ts:210-214 (schema)Zod schema for parsing the JFrog platform readiness API response (output schema).
export const JFrogPlatformReadinessSchema= z.object({ code: z.string() }); export type JFrogPlatformReadinessSchema = z.infer<typeof JFrogPlatformReadinessSchema>; - tools/repositories.ts:168-175 (registration)Export of RepositoryTools array registering the jfrog_check_availability tool among repository tools.
export const RepositoryTools =[ checkJfrogAvailabilityTool, createLocalRepositoryTool, createRemoteRepositoryTool, createVirtualRepositoryTool, setFolderPropertyTool, listRepositoriesTool ]; - common/utils.ts:55-92 (helper)HTTP request utility jfrogRequest used by the handler to communicate with JFrog API, handling auth via env vars and errors.
export async function jfrogRequest( urlPath: string, options: RequestOptions = {}, postProcess: (data: unknown) => unknown = (x) => x ): Promise<unknown> { const headers: Record<string, string> = { "Content-Type": "application/json", "User-Agent": USER_AGENT, ...options.headers, }; if (process.env.JFROG_ACCESS_TOKEN) { headers["Authorization"] = `Bearer ${process.env.JFROG_ACCESS_TOKEN}`; } const baseUrl = normalizeJFrogBaseUrl(process.env.JFROG_URL || ""); const path = urlPath.startsWith("/") ? urlPath.substring(1) : urlPath; const url = baseUrl ? `${baseUrl}${path}` : urlPath; try { const axiosConfig: AxiosRequestConfig = { method: options.method || "GET", url, headers, data: options.body, }; const response = await axios(axiosConfig); return postProcess(response.data); return response.data; } catch (error) { if (axios.isAxiosError(error) && error.response) { throw createJFrogError(error.response.status, error.response.data); } throw error; } }