Skip to main content
Glama
devlimelabs

MCP Environment & Installation Manager

by devlimelabs

activate-profile

Activate a specific configuration profile in the MCP Environment & Installation Manager to switch between different environment setups and server configurations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileIdYesProfile ID to activate

Implementation Reference

  • The handler function for the 'activate-profile' tool. Validates the profileId and calls ConfigService.setActiveProfile, returning a success JSON response.
    async ({ profileId }, extra) => {
      if (!profileId.trim()) {
        throw new Error("Profile ID cannot be empty");
      }
      
      await configService.setActiveProfile(profileId);
      
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              success: true,
              profileId
            }, null, 2)
          }
        ]
      };
    }
  • Zod input schema defining the required profileId parameter for the activate-profile tool.
    {
      profileId: z.string().describe("Profile ID to activate")
    },
  • Direct registration of the 'activate-profile' tool using server.tool, including schema and handler.
    server.tool(
      "activate-profile",
      {
        profileId: z.string().describe("Profile ID to activate")
      },
      async ({ profileId }, extra) => {
        if (!profileId.trim()) {
          throw new Error("Profile ID cannot be empty");
        }
        
        await configService.setActiveProfile(profileId);
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: true,
                profileId
              }, null, 2)
            }
          ]
        };
      }
    );
  • ConfigService method that validates the profile exists, sets it as active in memory, and persists the profiles config to disk.
    async setActiveProfile(id: string): Promise<void> {
      const profile = this.getProfile(id);
      if (!profile) {
        throw new Error(`Profile not found: ${id}`);
      }
      
      this.profilesConfig.activeProfile = id;
      await this.saveProfiles();
    }
  • src/server.ts:32-32 (registration)
    Invocation of registerProfileTools which registers the activate-profile tool among others.
    registerProfileTools(server, configService);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devlimelabs/mcp-env-manager-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server