Skip to main content

codebolt-problem

Error and issue detection system for identifying and matching problems in code and output.

Available Tools

  • problem_matcher_analyze - Analyze content for problems
  • problem_matcher_get_patterns - Get problem matcher patterns for a language
  • problem_matcher_add_pattern - Add a custom problem matcher pattern
  • problem_matcher_remove_pattern - Remove a custom problem matcher pattern
  • problem_matcher_list_problems - List problems in files

Tool Parameters

problem_matcher_analyze

Analyzes content (such as error output or build logs) for problems using pattern matching. Extracts structured problem information from raw text.

ParameterTypeRequiredDescription
contentstringYesThe content to analyze for problems (e.g., error messages, build output)
languagestringYesThe programming language context (e.g., "javascript", "typescript", "python")
filePathstringYesThe file path associated with the content being analyzed
expectedSeveritystringNoExpected severity level for filtering: error, warning, info, hint

problem_matcher_get_patterns

Retrieves the problem matcher patterns configured for a specific programming language.

ParameterTypeRequiredDescription
languagestringYesThe programming language to get patterns for (e.g., "javascript", "typescript", "python", "java", "csharp", "cpp")

problem_matcher_add_pattern

Adds a custom problem matcher pattern for a specific language. Allows extending the problem detection capabilities.

ParameterTypeRequiredDescription
namestringYesUnique name for the custom pattern (e.g., "custom-error-pattern")
languagestringYesThe programming language this pattern applies to
patternobjectYesThe pattern definition object
pattern.regexpstringYesRegular expression for matching problem lines
pattern.filenumberNoCapture group index for file path extraction
pattern.linenumberNoCapture group index for line number extraction
pattern.columnnumberNoCapture group index for column number extraction
pattern.severitynumberNoCapture group index for severity level extraction
pattern.messagenumberNoCapture group index for error message extraction

problem_matcher_remove_pattern

Removes a custom problem matcher pattern from a specific language configuration.

ParameterTypeRequiredDescription
namestringYesThe name of the pattern to remove
languagestringYesThe programming language the pattern belongs to

problem_matcher_list_problems

Lists all detected problems in files, optionally filtered by path, severity, or language.

ParameterTypeRequiredDescription
filePathstringNoFile or directory path to filter problems (e.g., "./src")
severitystringNoFilter by severity level: error, warning, info, hint, or all
languagestringNoFilter by programming language
limitnumberNoMaximum number of problems to return

Sample Usage

// Analyze content for problems
const analyzeResult = await codebolt.tools.executeTool(
"codebolt-problem",
"problem_matcher_analyze",
{
content: 'Error: Cannot find module "express"\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)',
language: 'javascript',
filePath: './src/app.js'
}
);

// Get problem matcher patterns for a language
const getPatternsResult = await codebolt.tools.executeTool(
"codebolt-problem",
"problem_matcher_get_patterns",
{ language: 'javascript' }
);

// Add a custom problem matcher pattern
const addPatternResult = await codebolt.tools.executeTool(
"codebolt-problem",
"problem_matcher_add_pattern",
{
name: 'custom-error-pattern',
language: 'javascript',
pattern: {
regexp: '^(.*?):(\\d+):(\\d+):\\s+(error|warning):\\s+(.*)$',
file: 1,
line: 2,
column: 3,
severity: 4,
message: 5
}
}
);

// Remove a custom problem matcher pattern
const removePatternResult = await codebolt.tools.executeTool(
"codebolt-problem",
"problem_matcher_remove_pattern",
{
name: 'custom-error-pattern',
language: 'javascript'
}
);

// List problems in files
const listProblemsResult = await codebolt.tools.executeTool(
"codebolt-problem",
"problem_matcher_list_problems",
{
filePath: './src',
severity: 'error'
}
);
info

This functionality provides pattern-based problem detection for build tools, linters, and compilers through the MCP interface.