The agent retrieves the schema of specified tables and executes a read-only SQL query, returning up to 1,000 rows of data without modifying the database.
The agent first uses the server to list available database connections and describe the schema of the relevant tables to ensure accurate SQL generation. It then constructs a SELECT or WITH statement based on the user's natural language request. Finally, it executes the query via the run_query tool, ensuring the result is returned within the 10-second timeout and 1,000-row limit.
- Category: Data and analysis
- Effect: Read-only
- MCP servers: AI2SQL MCP (https://koskamo.com/explore/ai2sql-mcp)
- Source: Text-to-SQL MCP Server for Postgres, MySQL & SQL Server | AI2SQL (https://ai2sql.io/mcp)
- Source quote: "Only a single SELECT or WITH statement runs; writes, DDL and multi-statement batches are rejected server-side."
- Playbook page: https://koskamo.com/explore/use-cases/analyze-database-schema-and-run-read-only-queries
Prompt: List my database connections. Then, describe the schema of the 'orders' table. Finally, run a query to show me last month's orders.