Skip to main content
Glama
bsmi021

MCP File Context Server

by bsmi021

set_profile

Activate a specific profile to configure context generation settings for code analysis and file operations.

Instructions

Set the active profile for context generation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profile_nameYesName of the profile to activate

Implementation Reference

  • Schema definition for the set_profile tool 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']
        }
    },
  • MCP tool handler for set_profile that delegates to ProfileService.setProfile and handles errors/logging
    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'}`
            );
        }
    }
  • Core ProfileService method implementing set_profile logic: validates profile, updates state, saves to file
    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'
        });
    }
  • src/index.ts:1614-1615 (registration)
    Tool dispatcher registration mapping 'set_profile' to handleSetProfile in CallToolRequestSchema handler
        return await this.handleSetProfile(request.params.arguments);
    case 'get_profile_context':
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Set the active profile') but doesn't reveal important behavioral traits: whether this is a persistent configuration change, if it affects subsequent operations, what permissions are required, if there are side effects, or what happens on failure. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single 7-word sentence that communicates the core purpose without any wasted words. It's front-loaded with the essential action and purpose. This is an example of efficient communication where every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a mutation tool (implied by 'Set') with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'active profile' means in the system context, how this affects other operations, what the expected outcome is, or provide any error handling information. For a tool that likely changes system state, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the single parameter 'profile_name' is fully documented in the schema), so the baseline is 3. The description doesn't add any parameter-specific information beyond what's already in the schema - it doesn't explain what constitutes a valid profile name, where profiles come from, or provide examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Set') and resource ('active profile'), and indicates the functional outcome ('for context generation'). However, it doesn't explicitly differentiate this from sibling tools like 'get_profile_context' or explain how 'set_profile' relates to other profile/context operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_profile_context' or 'read_context'. There's no mention of prerequisites, when this operation is needed, or what happens if no profile is set. The phrase 'for context generation' hints at a purpose but doesn't establish clear usage boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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