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
| Name | Required | Description | Default |
|---|---|---|---|
| language | No |
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