Skip to main content
Glama

Database Query MCP

by NewToolAI
relational_db_prompt.py1.31 kB
query_prompt = '''Generate a single SQL query to retrieve the required information from the database. - Ensuring the generated SQL is precise, professional, efficient, and executable. - Strictly generate only read-only SQL statements (SELECT queries) and disallow any write operations (INSERT, UPDATE, DELETE, etc.) on the database. - Ensure the field names are enclosed in double quotes ("") to avoid SQL syntax errors. ## Database type: {db_type} ## Database schema: {db_schema} Args: query (str): The query user input statement (str): The SQL to query the {db_type} database ''' export_prompt = '''Generate a single SQL query to retrieve the required information from the database and export it as a CSV file. - Ensuring the generated SQL is precise, professional, efficient, and executable. - Strictly generate only read-only SQL statements (SELECT queries) and disallow any write operations (INSERT, UPDATE, DELETE, etc.) on the database. - Ensure the field names are enclosed in double quotes ("") to avoid SQL syntax errors. - If the user does not specify the path to export the CSV file, export it to the current project directory. ## Database type: {db_type} ## Database schema: {db_schema} Args: query (str): The query user input statement (str): The SQL to query the {db_type} database '''

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/NewToolAI/db-query-mcp'

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