Skip to main content
Glama
vic3custodio

Trade Surveillance Support MCP Server

by vic3custodio

search_sql_configs

Search SQL configuration files using metadata keywords instead of file paths to locate trade surveillance configurations for compliance checks, reports, and transaction monitoring.

Instructions

Search for SQL configuration files using metadata keywords instead of file paths.

This tool searches through indexed SQL config files by their metadata annotations.
Files should include metadata comments like:

-- @keywords: trade, transaction, daily_report
-- @type: compliance_check
-- @description: Daily trade reconciliation report

Args:
    search_keywords: Keywords to search for (e.g., "trade settlement", "compliance", "daily report")
    config_directory: Path to the directory containing SQL config files (used for initial scan)
    
Returns:
    A dictionary containing matching config files with their metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_keywordsYes
config_directoryNo./configs

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'search_sql_configs' tool. It is registered via the @mcp.tool() decorator. The function searches SQL config files using a metadata index, scanning the directory if necessary, and returns matching configs based on keywords.
    @mcp.tool()
    async def search_sql_configs(
        search_keywords: str,
        config_directory: str = "./configs"
    ) -> dict[str, Any]:
        """
        Search for SQL configuration files using metadata keywords instead of file paths.
        
        This tool searches through indexed SQL config files by their metadata annotations.
        Files should include metadata comments like:
        
        -- @keywords: trade, transaction, daily_report
        -- @type: compliance_check
        -- @description: Daily trade reconciliation report
        
        Args:
            search_keywords: Keywords to search for (e.g., "trade settlement", "compliance", "daily report")
            config_directory: Path to the directory containing SQL config files (used for initial scan)
            
        Returns:
            A dictionary containing matching config files with their metadata
        """
        logger.info(f"Searching SQL configs for keywords: {search_keywords}")
        
        # Scan directory if index is empty
        if not metadata_index.index.get("sql_configs"):
            logger.info(f"Scanning SQL configs in: {config_directory}")
            metadata_index.scan_sql_configs(config_directory)
        
        # Search by keywords
        matches = metadata_index.search(search_keywords, file_type="sql")
        
        result = {
            "status": "success",
            "search_keywords": search_keywords,
            "matches_found": len(matches),
            "config_files": matches
        }
        
        logger.info(f"Found {len(matches)} SQL config matches")
        return result
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explaining the search mechanism (indexed files, metadata annotations), providing concrete examples of metadata format, and describing the return format. It doesn't mention performance characteristics, rate limits, or authentication needs, but covers the core behavior adequately.

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 efficiently structured with a clear purpose statement, usage explanation, metadata examples, and separate Args/Returns sections. Every sentence adds value, and information is well-organized without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, no annotations, but with output schema present, the description provides complete context: clear purpose, usage guidance, behavioral details, parameter explanations, and return format description. The output schema handles return structure, so the description focuses appropriately on operational context.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining both parameters: 'search_keywords' gets examples and context about metadata matching, and 'config_directory' explains its purpose ('used for initial scan') with a default value. The description adds significant meaning beyond the bare schema.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verb ('search') and resource ('SQL configuration files'), and distinguishes it from path-based searches by emphasizing metadata keyword searching. It explicitly differentiates from potential sibling tools by focusing on SQL config files rather than Java code or other resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('using metadata keywords instead of file paths') and includes examples of metadata annotations. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools, though the distinction from path-based searching is implied.

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/vic3custodio/mcp_test_2'

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