Skip to main content
Glama

set_profile

Activate a specific profile in the MCP File Context Server to define context generation settings for code analysis and processing.

Instructions

Set the active profile for context generation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profile_nameYesName of the profile to activate

Implementation Reference

  • MCP tool handler for 'set_profile' that extracts profile_name, calls ProfileService.setProfile, logs, and returns JSON response or error.
    private async handleSetProfile(args: any) { const { profile_name } = args; await this.loggingService.info('Setting profile', { profileName: profile_name, operation: 'set_profile' }); try { await this.profileService.setProfile(profile_name); const response = { message: `Successfully switched to profile: ${profile_name}`, timestamp: Date.now() }; await this.loggingService.info('Profile set successfully', { profileName: profile_name, operation: 'set_profile', response }); return this.createJsonResponse(response); } catch (error) { await this.loggingService.error('Failed to set profile', error as Error, { profileName: profile_name, operation: 'set_profile' }); throw new McpError( ErrorCode.InvalidParams, `Failed to set profile: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • Input schema and description for the set_profile tool defined in MCP server capabilities.
    set_profile: { description: 'Set the active profile for context generation. Available profiles: code (default), code-prompt (includes LLM instructions), code-file (saves to file)', inputSchema: { type: 'object', properties: { profile_name: { type: 'string', description: 'Name of the profile to activate' } }, required: ['profile_name'] } },
  • src/index.ts:1613-1615 (registration)
    Registration of the set_profile handler in the CallToolRequestSchema switch statement.
    case 'set_profile': return await this.handleSetProfile(request.params.arguments); case 'get_profile_context':
  • Supporting method in ProfileService that performs the actual profile switching logic, updates state, and persists it.
    public async setProfile(profileName: string): Promise<void> { await this.logger?.info('Attempting to set profile', { profileName, availableProfiles: Object.keys(this.config.profiles), operation: 'set_profile' }); if (!this.config.profiles[profileName]) { throw new Error(`Profile '${profileName}' does not exist. Available profiles: ${Object.keys(this.config.profiles).join(', ')}`); } this.state = { ...this.state, profile_name: profileName, timestamp: Date.now() }; await this.saveState(); await this.logger?.info('Successfully set profile', { profileName, operation: 'set_profile' }); }

Other Tools

Related Tools

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/bsmi021/mcp-file-context-server'

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