create-profile
Generate and configure environment profiles in the MCP Environment & Installation Manager, enabling efficient management of server settings and local package installations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Description of the profile | |
| name | Yes | Name of the profile |
Implementation Reference
- src/tools/profile-tools.ts:67-92 (registration)Registers the 'create-profile' MCP tool with Zod input schema validation and handler that delegates to ConfigService.createProfile and returns JSON responseserver.tool( "create-profile", { name: z.string().describe("Name of the profile"), description: z.string().optional().describe("Description of the profile") }, async ({ name, description }, extra) => { if (!name.trim()) { throw new Error("Profile name cannot be empty"); } const profile = await configService.createProfile(name, description); return { content: [ { type: "text", text: JSON.stringify({ success: true, profile }, null, 2) } ] }; } );
- src/tools/profile-tools.ts:73-92 (handler)The inline handler function for the create-profile tool that performs basic validation and orchestrates the responseasync ({ name, description }, extra) => { if (!name.trim()) { throw new Error("Profile name cannot be empty"); } const profile = await configService.createProfile(name, description); return { content: [ { type: "text", text: JSON.stringify({ success: true, profile }, null, 2) } ] }; } );
- src/tools/profile-tools.ts:70-72 (schema)Zod schema for create-profile tool input parameters: name (required string), description (optional string)name: z.string().describe("Name of the profile"), description: z.string().optional().describe("Description of the profile") },
- Core implementation of profile creation: generates unique ID, creates Profile object, appends to profiles array, and persists to fileasync createProfile(name: string, description?: string): Promise<Profile> { const id = `${name.toLowerCase().replace(/[^a-z0-9]/g, '-')}-${Date.now().toString(36)}`; const now = new Date().toISOString(); const profile: Profile = { id, name, description, createdAt: now, updatedAt: now }; this.profilesConfig.profiles.push(profile); await this.saveProfiles(); return profile; }