update-profile
Modify profile details in the MCP Environment & Installation Manager by updating the name, description, or other attributes associated with a specific profile ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | New description for the profile | |
| name | No | New name for the profile | |
| profileId | Yes | Profile ID to update |
Implementation Reference
- src/tools/profile-tools.ts:102-134 (handler)The main handler function for the 'update-profile' MCP tool. It validates inputs, constructs updates object, calls configService.updateProfile, and returns a JSON-formatted success response with the updated profile.async ({ profileId, name, description }, extra) => { if (!profileId.trim()) { throw new Error("Profile ID cannot be empty"); } if (name !== undefined && !name.trim()) { throw new Error("Profile name cannot be empty"); } const updates: { name?: string; description?: string } = {}; if (name !== undefined) { updates.name = name; } if (description !== undefined) { updates.description = description; } const profile = await configService.updateProfile(profileId, updates); return { content: [ { type: "text", text: JSON.stringify({ success: true, profile }, null, 2) } ] }; }
- src/tools/profile-tools.ts:97-101 (schema)Zod schema defining the input parameters for the 'update-profile' tool: required profileId and optional name, description.{ profileId: z.string().describe("Profile ID to update"), name: z.string().optional().describe("New name for the profile"), description: z.string().optional().describe("New description for the profile") },
- src/tools/profile-tools.ts:95-135 (registration)The server.tool call that registers the 'update-profile' tool on the MCP server, including schema and handler.server.tool( "update-profile", { profileId: z.string().describe("Profile ID to update"), name: z.string().optional().describe("New name for the profile"), description: z.string().optional().describe("New description for the profile") }, async ({ profileId, name, description }, extra) => { if (!profileId.trim()) { throw new Error("Profile ID cannot be empty"); } if (name !== undefined && !name.trim()) { throw new Error("Profile name cannot be empty"); } const updates: { name?: string; description?: string } = {}; if (name !== undefined) { updates.name = name; } if (description !== undefined) { updates.description = description; } const profile = await configService.updateProfile(profileId, updates); return { content: [ { type: "text", text: JSON.stringify({ success: true, profile }, null, 2) } ] }; } );
- The ConfigService.updateProfile helper method that performs the actual profile update by modifying the in-memory profiles array, updating timestamp, saving to persistent storage, and returning the updated profile.async updateProfile(id: string, updates: Partial<Pick<Profile, 'name' | 'description'>>): Promise<Profile> { const profileIndex = this.profilesConfig.profiles.findIndex(p => p.id === id); if (profileIndex === -1) { throw new Error(`Profile not found: ${id}`); } const profile = this.profilesConfig.profiles[profileIndex]; const updatedProfile = { ...profile, ...updates, updatedAt: new Date().toISOString() }; this.profilesConfig.profiles[profileIndex] = updatedProfile; await this.saveProfiles(); return updatedProfile; }
- src/server.ts:32-32 (registration)Top-level call to registerProfileTools which includes the 'update-profile' tool registration.registerProfileTools(server, configService);