Skip to main content
Glama
wrale

mcp-server-tree-sitter

by wrale

list_query_templates_tool

Retrieve available query templates, optionally filtered by programming language, to enhance code analysis using the MCP server with tree-sitter integration.

Instructions

List available query templates.

    Args:
        language: Optional language to filter by

    Returns:
        Available templates
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNo

Implementation Reference

  • The main handler function for the 'list_query_templates_tool' MCP tool. It is registered via the @mcp_server.tool() decorator and delegates to the list_query_templates helper function.
    @mcp_server.tool()
    def list_query_templates_tool(language: Optional[str] = None) -> Dict[str, Any]:
        """List available query templates.
    
        Args:
            language: Optional language to filter by
    
        Returns:
            Available templates
        """
        from ..language.query_templates import list_query_templates
    
        return list_query_templates(language)
  • Core helper function that implements the logic for listing query templates, returning the QUERY_TEMPLATES dictionary optionally filtered by language.
    def list_query_templates(language: Optional[str] = None) -> Dict[str, Any]:
        """
        List available query templates.
    
        Args:
            language: Optional language to filter by
    
        Returns:
            Dictionary of templates by language
        """
        if language:
            return {language: QUERY_TEMPLATES.get(language, {})}
        return QUERY_TEMPLATES
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 for behavioral disclosure. While 'List' implies a read-only operation, the description doesn't address important behavioral aspects like whether this returns all templates at once or uses pagination, what format the templates are returned in, whether authentication is required, or any rate limits. The minimal description leaves significant behavioral questions unanswered.

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 brief but structured with separate Args and Returns sections. The core purpose statement is front-loaded, but the formatting with indentation and section headers adds unnecessary visual complexity. The content is concise but could be more efficiently presented as a single paragraph without the structured formatting.

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?

For a tool with no annotations, no output schema, and minimal parameter documentation, the description is inadequate. It doesn't explain what 'query templates' are in this context, what information is returned about each template, or how the results are structured. The agent would struggle to understand what to expect from invoking this tool beyond the basic fact that it lists something.

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?

With 0% schema description coverage (the schema has no descriptions for the 'language' parameter), the description partially compensates by mentioning 'Optional language to filter by' in the Args section. This adds useful semantic context about filtering functionality that isn't in the schema. However, it doesn't specify what language values are valid or provide examples.

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 verb ('List') and resource ('available query templates'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential siblings like 'get_query_template_tool' (singular) or 'list_files'/'list_languages'/'list_projects_tool' (other list operations).

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. With siblings like 'get_query_template_tool' (singular retrieval) and 'list_files'/'list_languages' (other listing operations), there's no indication of when this specific listing operation is appropriate versus those other tools.

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

Related 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/wrale/mcp-server-tree-sitter'

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