env_group_create
Creates a new environment group for organizing API testing environments. Directories can then be added as scopes to group related resources.
Instructions
Crea un nuevo grupo de entornos. Luego añade scopes (directorios) con env_group_add_scope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Nombre del grupo (ej: cocaxcode, optimizatusol) |
Implementation Reference
- src/tools/environment.ts:503-521 (handler)Tool handler for env_group_create. Registers the 'env_group_create' tool on the MCP server, accepts a 'name' parameter (z.string), and calls storage.createGroup(params.name). Returns success message or error.
// ── env_group_create ── server.tool( 'env_group_create', 'Crea un nuevo grupo de entornos. Luego añade scopes (directorios) con env_group_add_scope.', { name: z.string().describe('Nombre del grupo (ej: cocaxcode, optimizatusol)'), }, async (params) => { try { await storage.createGroup(params.name) return { content: [{ type: 'text' as const, text: `Grupo '${params.name}' creado. Usa env_group_add_scope para añadir directorios.` }], } } catch (error) { const message = error instanceof Error ? error.message : String(error) return { content: [{ type: 'text' as const, text: `Error: ${message}` }], isError: true } } }, ) - src/tools/environment.ts:6-6 (registration)The tool is registered inside the registerEnvironmentTools function, which creates all environment-related tools (env_create, env_group_create, etc.) on the MCP server.
export function registerEnvironmentTools(server: McpServer, storage: Storage): void { - src/lib/storage.ts:386-396 (helper)Storage.createGroup() creates a new EnvironmentGroup with the given name. Checks if group already exists (throws if so), creates the group object with empty scopes and timestamps, then saves it as a JSON file in the groups directory.
async createGroup(name: string): Promise<EnvironmentGroup> { await this.ensureDir('groups') const existing = await this.getGroup(name) if (existing) { throw new Error(`El grupo '${name}' ya existe`) } const now = new Date().toISOString() const group: EnvironmentGroup = { name, scopes: [], createdAt: now, updatedAt: now } await this.saveGroup(group) return group } - src/lib/types.ts:82-88 (schema)TypeScript interface for EnvironmentGroup, which is the data type that env_group_create produces. Contains name, scopes, optional default, createdAt, and updatedAt fields.
export interface EnvironmentGroup { name: string scopes: string[] default?: string createdAt: string updatedAt: string }