jfrog_list_environments
Retrieve a detailed list of environment types in the JFrog Platform, such as dev and prod, using this API tool.
Instructions
Get a list of all environments types (e.g. dev, prod, etc.) in the JFrog platform with their details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/access.ts:6-12 (handler)Core handler function that fetches the list of JFrog environments via API and parses the response using the schema.export async function getAllEnvironments() { const response = await jfrogRequest("/access/api/v1/environments", { method: "GET", }); return accessSchemas.JFrogEnvironmentNamesSchema.parse(response); }
- schemas/access.ts:20-24 (schema)Zod schema for parsing the API response of environment names.export const JFrogEnvironmentNamesSchema = z.array( z.object({ name: z.string().describe("Environment name") }) );
- tools/access.ts:41-49 (registration)Local tool definition including name, description, input schema, and handler reference.const getAllEnvironmentsTool = { name: "jfrog_list_environments", description: "Get a list of all environments types (e.g. dev, prod, etc.) in the JFrog platform with their details", inputSchema: zodToJsonSchema(z.object({})), //outputSchema: zodToJsonSchema(z.object({})), handler: async (args: any) => { return await getAllEnvironments(); } };
- tools/access.ts:85-90 (registration)Groups access-related tools into AccessTools array.export const AccessTools = [ getAllEnvironmentsTool, listAllProjectsTool, createProjectTool, getSpecificProjectTool ];
- tools/index.ts:13-23 (registration)Main tools registry that includes AccessTools, exposing jfrog_list_environments globally.export const tools =[ ...RepositoryTools, ...BuildsTools, ...RuntimeTools, ...AccessTools, ...AQLTools, ...CatalogTools, ...CurationTools, ...PermissionsTools, ...ArtifactSecurityTools, ];