Skip to main content
Glama

update_project_config

Configure project-specific settings for AI assistants, including allowed commands, auto-formatting, git auto-commit, and format command, to control workspace behavior.

Instructions

Update specific project configuration settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allowedCommandsNoCommands that are allowed to run
formatOnSaveNoAuto-format files after editing
gitAutoCommitNoAuto-commit AI changes
formatCommandNoFormat command (use {{file}} as placeholder)
projectInstructionsNoProject-specific instructions for AI

Implementation Reference

  • Tool execution handler for 'update_project_config'. Loads current config, merges with incoming args, and saves the updated config back.
    case 'update_project_config':
      const currentConfig = await this.projectConfigService.loadProjectConfig();
      const updatedConfig = { ...currentConfig, ...args };
      return await this.projectConfigService.saveProjectConfig(updatedConfig);
  • Tool definition/schema for 'update_project_config' with input validation properties (allowedCommands, formatOnSave, gitAutoCommit, formatCommand, projectInstructions).
    {
      name: 'update_project_config',
      description: 'Update specific project configuration settings',
      inputSchema: {
        type: 'object',
        properties: {
          allowedCommands: {
            type: 'array',
            items: { type: 'string' },
            description: 'Commands that are allowed to run'
          },
          formatOnSave: {
            type: 'boolean',
            description: 'Auto-format files after editing'
          },
          gitAutoCommit: {
            type: 'boolean',
            description: 'Auto-commit AI changes'
          },
          formatCommand: {
            type: 'string',
            description: 'Format command (use {{file}} as placeholder)'
          },
          projectInstructions: {
            type: 'string',
            description: 'Project-specific instructions for AI'
          }
        }
      }
  • src/index.ts:112-114 (registration)
    Registration of all tool definitions (including 'update_project_config') via ListToolsRequestSchema handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOL_DEFINITIONS,
    }));
  • Helper method that serializes the ProjectConfig to TOML and writes it to .vscode-mcp.toml. Called by the handler after merging.
    async saveProjectConfig(config: ProjectConfig, workspacePath?: string): Promise<ToolResult> {
      try {
        const resolvedPath = workspacePath || this.workspaceService.workspacePath;
        const configPath = path.join(resolvedPath, ProjectConfigService.CONFIG_FILENAME);
        
        const tomlContent = toml.stringify(config as any);
        await fs.writeFile(configPath, tomlContent, 'utf-8');
        
        // Update cache
        this.configCache.set(configPath, config);
        
        return {
          content: [{
            type: 'text',
            text: `Project configuration saved to ${configPath}`
          }]
        };
      } catch (error) {
        return {
          isError: true,
          content: [{
            type: 'text',
            text: `Failed to save project configuration: ${error}`
          }]
        };
      }
    }
  • Helper method that loads the current project config from .vscode-mcp.toml (used by the handler to get the current state before merging).
    async loadProjectConfig(workspacePath?: string): Promise<ProjectConfig> {
      const resolvedPath = workspacePath || this.workspaceService.workspacePath;
      const configPath = path.join(resolvedPath, ProjectConfigService.CONFIG_FILENAME);
      
      // Check cache first
      if (this.configCache.has(configPath)) {
        return this.configCache.get(configPath)!;
      }
    
      try {
        const configContent = await fs.readFile(configPath, 'utf-8');
        const parsedConfig = toml.parse(configContent) as any;
        
        // Handle nested TOML structure
        const flatConfig: Partial<ProjectConfig> = {
          // General settings
          formatOnSave: parsedConfig.general?.formatOnSave ?? parsedConfig.formatOnSave,
          gitAutoCommit: parsedConfig.general?.gitAutoCommit ?? parsedConfig.gitAutoCommit,
          gitAutoCommitMessage: parsedConfig.general?.gitAutoCommitMessage ?? parsedConfig.gitAutoCommitMessage,
          sessionTracking: parsedConfig.general?.sessionTracking ?? parsedConfig.sessionTracking,
          maxSessionCommits: parsedConfig.general?.maxSessionCommits ?? parsedConfig.maxSessionCommits,
          formatCommand: parsedConfig.general?.formatCommand ?? parsedConfig.formatCommand,
          format: parsedConfig.general?.format ?? parsedConfig.format,
          
          // Security settings
          allowedCommands: parsedConfig.security?.allowedCommands ?? parsedConfig.allowedCommands ?? [],
          
          // Project settings
          projectInstructions: parsedConfig.project?.projectInstructions ?? parsedConfig.projectInstructions,
          projectDescription: parsedConfig.project?.projectDescription ?? parsedConfig.projectDescription,
          
          // Custom tools
          customTools: parsedConfig.customTools ?? parsedConfig.project?.customTools,
          
          // Remote server
          remoteServer: parsedConfig.remoteServer
        };
        
        // Merge with defaults
        const config = this.mergeWithDefaults(flatConfig);
        
        this.configCache.set(configPath, config);
        return config;
      } catch (error) {
        // Return default config if file doesn't exist or can't be parsed
        const defaultConfig = this.getDefaultConfig();
        this.configCache.set(configPath, defaultConfig);
        return defaultConfig;
      }
    }
Behavior2/5

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

With no annotations, the description carries the full burden for behavioral disclosure. It only says 'update', with no details about persistence, reversibility, permissions, or side effects. For a mutation tool, this is insufficient.

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

Conciseness3/5

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

The description is very short (one sentence) but lacks substance. It is concise but fails to provide useful information, making it somewhat wasteful.

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 five parameters and no output schema, the description is too brief. It does not explain the scope of 'project configuration', how settings persist, or how this tool relates to its siblings.

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 coverage is 100%, so the baseline is 3. The description adds no meaning beyond the schema; it simply restates the purpose without elaborating on parameter usage or relationships.

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 action ('update') and the resource ('project configuration settings'). It is not a tautology, but it is generic and does not differentiate from sibling tools like 'save_project_config' or 'load_project_config'.

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?

No guidance is provided on when to use this tool versus alternatives such as 'add_allowed_command' or 'save_project_config'. There is no mention of context or exclusions.

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/agentics-ai/code-mcp'

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