Skip to main content
Glama

suggest_file_patterns

Suggest file patterns for a project to generate Doxygen documentation, with options for language, tests, and examples.

Instructions

Suggest appropriate file patterns for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
primary_languageNo
include_testsNo
include_examplesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual handler function for the 'suggest_file_patterns' tool. It is decorated with @mcp.tool(), accepts project_path, primary_language, include_tests, and include_examples parameters, analyzes actual files in the project directory, and returns suggested file patterns for Doxygen configuration.
    @mcp.tool()
    async def suggest_file_patterns(
        project_path: str,
        primary_language: str = "",
        include_tests: bool = False,
        include_examples: bool = True,
    ) -> str:
        """Suggest appropriate file patterns for a project"""
        project_path = Path(project_path)
        
        if not project_path.exists():
            return f"āŒ Project path does not exist: {project_path}"
        
        try:
            # Analyze actual files in the project
            extensions = {}
            for file_path in project_path.rglob("*"):
                if file_path.is_file():
                    ext = file_path.suffix.lower()
                    if ext:
                        extensions[ext] = extensions.get(ext, 0) + 1
            
            # Language-specific pattern suggestions
            language_patterns = {
                "c": ["*.c", "*.h"],
                "cpp": ["*.cpp", "*.cxx", "*.cc", "*.C", "*.hpp", "*.hxx", "*.hh", "*.H"],
                "python": ["*.py", "*.pyx", "*.pyi"],
                "java": ["*.java"],
                "php": ["*.php", "*.php3", "*.inc"],
                "javascript": ["*.js", "*.jsx", "*.ts", "*.tsx"],
                "csharp": ["*.cs"],
                "go": ["*.go"],
                "rust": ["*.rs"]
            }
            
            # Build suggestions based on found files and language
            suggested_patterns = []
            
            if primary_language.lower() in language_patterns:
                suggested_patterns.extend(language_patterns[primary_language.lower()])
    
            # Add patterns based on actual files found
            common_source_extensions = {
                ".c", ".cpp", ".cxx", ".cc", ".h", ".hpp", ".hxx", ".hh",
                ".py", ".java", ".php", ".js", ".jsx", ".ts", ".tsx",
                ".cs", ".go", ".rs", ".rb", ".pl", ".sh"
            }
    
            for ext in extensions:
                if ext in common_source_extensions:
                    pattern = f"*{ext}"
                    if pattern not in suggested_patterns:
                        suggested_patterns.append(pattern)
    
            # Optional patterns
            optional_patterns = []
            if include_examples and any(ext in [".md", ".txt", ".rst"] for ext in extensions):
                optional_patterns.extend(["*.md", "*.txt", ".rst"])
    
            if include_tests:
                optional_patterns.extend(["test_*.py", "*_test.cpp", "Test*.java"])
    
            result_text = f"""šŸ“‹ File Pattern Suggestions for: {project_path}
    
    šŸŽÆ Recommended Patterns:
    {chr(10).join(f"  šŸ“„ {pattern}" for pattern in suggested_patterns)}
    
    šŸ“Š Found Extensions:
    {chr(10).join(f"  {ext}: {count} files" for ext, count in sorted(extensions.items(), key=lambda x: x[1], reverse=True)[:10])}
    """
    
            if optional_patterns:
                result_text += f"\nšŸ”§ Optional Patterns:\n{chr(10).join(f'  šŸ“„ {pattern}' for pattern in optional_patterns)}"
    
            result_text += f"\n\nšŸ’” Add these patterns to your Doxyfile:\nFILE_PATTERNS = {' '.join(suggested_patterns)}"
    
            return result_text
    
        except Exception as e:
            return f"āŒ Error analyzing patterns: {str(e)}"
  • The @mcp.tool() decorator registers 'suggest_file_patterns' as an MCP tool on the FastMCP server instance named 'Doxygen'.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, and the description fails to disclose any behavioral traits beyond the basic purpose. It does not mention side effects, prerequisites, or what the tool returns (despite having an output schema).

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 extremely concise (one sentence) with no wasted text, but it is underspecified given the complexity of four parameters and an output schema. Conciseness is positive but sacrifices necessary detail.

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?

The description is incomplete for a tool with multiple parameters and an output schema. It lacks context about the tool's role in the documentation workflow (e.g., suggesting patterns for Doxygen configuration), making it hard for an agent to select appropriately.

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

Parameters2/5

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

With 0% schema description coverage, the description adds no meaning to the parameters. For example, 'project_path', 'primary_language', 'include_tests' are not explained; the description only says 'file patterns' without linking to parameters.

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 'Suggest appropriate file patterns for a project' states a clear verb and resource, but it is vague about what 'file patterns' means and lacks differentiation from sibling tools such as 'scan_project' or 'generate_documentation'.

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 like 'scan_project' or 'validate_documentation'. The description gives no usage 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/Positronikal/doxygen-mcp'

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