Skip to main content
Glama

run_linter

Analyze code for style and quality issues, with options to fix problems automatically or target specific files.

Instructions

Run standardized linter for the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fixNoAttempt to fix issues automatically
filesNoSpecific files to lint

Implementation Reference

  • RunLinterTool class extending BaseExecTool that implements the core logic for building and executing the linter command based on project configuration and provided options (fix, files).
    class RunLinterTool extends BaseExecTool<LinterOptions> {
      protected getActionName(): string {
        return 'Lint';
      }
    
      protected async buildCommand(args: LinterOptions): Promise<string> {
        const { fix = false, files = [] } = args;
        const config = await loadProjectConfig();
        
        const command = config.lintCommand ?? 'npm run lint';
        const parts = [command];
        
        if (fix && !command.includes('--fix')) {
          parts.push('--fix');
        }
        
        if (files.length > 0) {
          parts.push(...files);
        }
        
        return parts.join(' ');
      }
    }
  • TypeScript interface defining the input schema for the run_linter tool, matching the Zod schema used in registration.
    export interface LinterOptions {
      fix?: boolean;
      files?: string[];
    }
  • src/index.ts:82-93 (registration)
    Registers the 'run_linter' MCP tool with the server, including Zod inputSchema, description, and handler that delegates to runLinter function.
    // Register run_linter tool
    server.registerTool(
      'run_linter',
      {
        description: 'Run standardized linter for the project',
        inputSchema: {
          fix: z.boolean().optional().default(false).describe('Attempt to fix issues automatically'),
          files: z.array(z.string()).optional().describe('Specific files to lint'),
        },
      },
      async (args) => runLinter(args)
    );
  • Exported runLinter function that instantiates RunLinterTool and executes it with the provided arguments, serving as the entry point called by the registration handler.
    export async function runLinter(args: LinterOptions): Promise<CallToolResult> {
      return tool.execute(args);
    }
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 mentions 'Run' but doesn't specify whether this is a read-only analysis or if it modifies files (though the 'fix' parameter hints at potential changes). It lacks details on permissions needed, side effects (e.g., file modifications), output format, or error handling, which are critical for a tool that might alter code.

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, efficient sentence with zero waste. It's front-loaded with the core action and target, making it easy to parse quickly. No unnecessary words or redundancy are present.

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 complexity of a linter tool (which can analyze and potentially fix code), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., linting results, success/failure), behavioral traits like side effects, or how it differs from siblings. This leaves significant gaps for an agent to use it effectively.

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%, so the schema already documents both parameters ('fix' and 'files') clearly. The description adds no additional meaning about parameters beyond what's in the schema, such as how 'files' are resolved or what 'fix' entails. This meets the baseline for high schema coverage but doesn't enhance understanding.

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

Purpose3/5

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

The description states the action ('Run') and target ('standardized linter for the project'), which gives a basic understanding of purpose. However, it's vague about what 'standardized linter' means (e.g., which language, what rules), and doesn't distinguish this from sibling tools like 'review_code' or 'run_tests' that might also analyze code quality. It avoids tautology but lacks specificity.

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. There's no mention of context (e.g., after code changes, as part of CI/CD), prerequisites, or comparisons to siblings like 'review_code' or 'run_tests'. This leaves the agent guessing about appropriate usage scenarios.

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/jaggederest/mcp_reviewer'

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