Skip to main content
Glama

overseer.lint_repo

Detect repository languages and generate linting commands based on coding standards in sentinel.yml to enforce code quality.

Instructions

Detects languages in the repository and recommends linting commands based on coding standards in sentinel.yml.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_rootYesRoot path of the repository
optionsNo

Implementation Reference

  • The primary handler function for the 'overseer.lint_repo' tool. It processes the repository path, detects languages using RepoAnalyzer, loads coding standards from config, generates recommended linting and fix commands for detected languages, and returns structured results including detected languages, commands, and summary (issues are stubbed).
    export async function handleLintRepo(
      args: {
        repo_root: string;
        options?: {
          fix?: boolean;
          languages?: string[];
        };
      },
      configLoader: ConfigLoader
    ): Promise<{
      success: boolean;
      detected_languages: string[];
      recommended_commands: Array<{
        language: string;
        command: string;
        description: string;
        fix_command?: string;
      }>;
      issues: Array<{
        file: string;
        line: number;
        column: number;
        severity: 'error' | 'warning' | 'info';
        message: string;
        rule: string;
      }>;
      summary: {
        total_issues: number;
        errors: number;
        warnings: number;
        files_checked: number;
      };
    }> {
      try {
        // Resolve repo path
        let repoPath = args.repo_root;
        if (!repoPath.startsWith('/')) {
          repoPath = join(homedir(), 'dev', repoPath);
        }
        repoPath = FSUtils.expandPath(repoPath);
    
        if (!FSUtils.dirExists(repoPath)) {
          return {
            success: false,
            detected_languages: [],
            recommended_commands: [],
            issues: [],
            summary: {
              total_issues: 0,
              errors: 0,
              warnings: 0,
              files_checked: 0,
            },
          };
        }
    
        // Analyze repository to detect languages
        const analysis = RepoAnalyzer.analyzeRepo(repoPath, {
          detect_frameworks: true,
          detect_infrastructure: false,
        });
    
        // Extract detected languages
        const languagePatterns = analysis.patterns.filter(p => p.type === 'language');
        const detectedLanguages = languagePatterns.map(p => p.name);
    
        // Get coding standards from config
        const config = configLoader.getConfig();
        const codingStandards = config.coding_standards;
    
        // Generate recommended commands
        const recommendedCommands: Array<{
          language: string;
          command: string;
          description: string;
          fix_command?: string;
        }> = [];
    
        for (const lang of detectedLanguages) {
          const standards = codingStandards.languages[lang];
          if (standards) {
            const linter = standards.linter;
            const formatter = standards.formatter;
    
            // Generate lint command
            let lintCommand = '';
            let fixCommand = '';
    
            if (lang === 'typescript' || lang === 'javascript') {
              if (linter === 'eslint') {
                lintCommand = 'npx eslint . --ext .ts,.tsx,.js,.jsx';
                if (args.options?.fix) {
                  fixCommand = 'npx eslint . --ext .ts,.tsx,.js,.jsx --fix';
                }
              }
              if (formatter === 'prettier' && !lintCommand) {
                lintCommand = 'npx prettier --check .';
                if (args.options?.fix && !fixCommand) {
                  fixCommand = 'npx prettier --write .';
                }
              }
            } else if (lang === 'python') {
              if (linter === 'pylint') {
                lintCommand = 'pylint **/*.py';
              }
              if (formatter === 'black' && !lintCommand) {
                lintCommand = 'black --check .';
                if (args.options?.fix && !fixCommand) {
                  fixCommand = 'black .';
                }
              }
            }
    
            if (lintCommand) {
              recommendedCommands.push({
                language: lang,
                command: lintCommand,
                description: `Run ${linter || formatter} for ${lang} files`,
                fix_command: fixCommand,
              });
            }
          } else {
            // Default recommendations
            recommendedCommands.push({
              language: lang,
              command: `# No specific linter configured for ${lang}`,
              description: `Add ${lang} linting configuration to sentinel.yml`,
            });
          }
        }
    
        // For now, return empty issues (actual linting would be implemented later)
        return {
          success: true,
          detected_languages: detectedLanguages,
          recommended_commands: recommendedCommands,
          issues: [],
          summary: {
            total_issues: 0,
            errors: 0,
            warnings: 0,
            files_checked: 0,
          },
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          success: false,
          detected_languages: [],
          recommended_commands: [],
          issues: [],
          summary: {
            total_issues: 0,
            errors: 0,
            warnings: 0,
            files_checked: 0,
          },
        };
      }
    }
  • Factory function that creates the Tool object for 'overseer.lint_repo', defining its name, description, and input schema for repo_root and optional options.
    export function createLintRepoTool(configLoader: ConfigLoader): Tool {
      return {
        name: 'overseer.lint_repo',
        description: 'Detects languages in the repository and recommends linting commands based on coding standards in sentinel.yml.',
        inputSchema: {
          type: 'object',
          required: ['repo_root'],
          properties: {
            repo_root: {
              type: 'string',
              description: 'Root path of the repository',
            },
            options: {
              type: 'object',
              properties: {
                fix: {
                  type: 'boolean',
                  default: false,
                  description: 'Automatically fix issues where possible',
                },
                languages: {
                  type: 'array',
                  items: { type: 'string' },
                  description: 'Specific languages to lint (default: all detected)',
                },
              },
            },
          },
        },
      };
    }
  • The createTools function registers the lint_repo tool by including createLintRepoTool(context.configLoader) in the array of tools returned.
    export function createTools(context: ToolContext): Tool[] {
      return [
        // Planning tools
        createPlanProjectTool(context.phaseManager),
        createInferPhasesTool(context.configLoader),
        createUpdatePhasesTool(context.phaseManager),
        // Execution tools
        createRunPhaseTool(context.phaseManager),
        createAdvancePhaseTool(context.phaseManager),
        createStatusTool(context.phaseManager),
        // QA tools
        createLintRepoTool(context.configLoader),
        createSyncDocsTool(context.phaseManager),
        createCheckComplianceTool(context.phaseManager),
        // Environment tools
        createEnvMapTool(context.phaseManager),
        createGenerateCiTool(context.phaseManager),
        createSecretsTemplateTool(context.phaseManager),
      ];
    }
  • In the central handleToolCall switch statement, the 'overseer.lint_repo' case dispatches to the handleLintRepo function with arguments and configLoader.
    case 'overseer.lint_repo':
      return await handleLintRepo(args, context.configLoader);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions detection and recommendation behaviors but doesn't disclose critical traits like whether this is a read-only analysis tool, if it modifies files (the 'fix' option suggests potential writes), what permissions are needed, rate limits, or output format. For a tool with a 'fix' parameter and no annotations, this is a significant gap in behavioral disclosure.

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 a single, well-structured sentence that efficiently conveys the core functionality without waste. It's front-loaded with the main purpose and includes key context ('based on coding standards in sentinel.yml'). Every word earns its place, making it highly concise.

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 the tool's complexity (language detection, linting recommendations, optional fixes), no annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It doesn't explain what the tool returns, how recommendations are formatted, or behavioral implications of the 'fix' option. For a tool that could potentially modify files, this lack of completeness is problematic.

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 50% (only 'repo_root' and 'fix' have descriptions, 'languages' lacks one). The description doesn't add parameter semantics beyond what's in the schema—it doesn't explain what 'sentinel.yml' contains, how languages are detected, or what the recommendations look like. With partial schema coverage, the description doesn't compensate adequately, resulting in a baseline score.

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

Purpose5/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 specific verbs ('detects languages', 'recommends linting commands') and resources ('repository', 'coding standards in sentinel.yml'). It distinguishes itself from siblings like overseer.check_compliance or overseer.run_phase by focusing specifically on language detection and linting command recommendations rather than broader compliance checking or execution.

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

Usage Guidelines3/5

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

The description implies usage context ('based on coding standards in sentinel.yml') but doesn't explicitly state when to use this tool versus alternatives. It doesn't mention prerequisites like needing sentinel.yml to exist or when to choose this over other linting or analysis tools among the siblings. The guidance is present but incomplete.

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/freqkflag/PROJECT-OVERSEER-MCP'

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