execute_sql
Execute SQL queries on databases within a workspace group using SingleStore MCP Server. Retrieve formatted results, metadata, and execution status while adhering to strict read-only query restrictions for security.
Instructions
Execute SQL operations on a database attached to workspace within a workspace group and receive formatted results.
Returns:
- Query results with column names and typed values
- Row count and metadata
- Execution status
⚠️ CRITICAL SECURITY WARNINGS:
- Never display or log credentials in responses
- Use only READ-ONLY queries (SELECT, SHOW, DESCRIBE)
- DO NOT USE data modification statements:
x No INSERT/UPDATE/DELETE
x No DROP/CREATE/ALTER
- Ensure queries are properly sanitized
Args:
workspace_group_identifier: ID/name of the workspace group
workspace_identifier: ID/name of the specific workspace within the workspace group
database: Name of the database to query
sql_query: The SQL query to execute
Returns:
Dictionary with query results and metadata
Input Schema
Name | Required | Description | Default |
---|---|---|---|
ctx | No | ||
database | Yes | ||
password | Yes | ||
sql_query | Yes | ||
username | Yes | ||
workspace_group_identifier | Yes | ||
workspace_identifier | Yes |
Input Schema (JSON Schema)
{
"$defs": {
"Context": {
"description": "Context object providing access to MCP capabilities.\n\nThis provides a cleaner interface to MCP's RequestContext functionality.\nIt gets injected into tool and resource functions that request it via type hints.\n\nTo use context in a tool function, add a parameter with the Context type annotation:\n\n```python\n@server.tool()\ndef my_tool(x: int, ctx: Context) -> str:\n # Log messages to the client\n ctx.info(f\"Processing {x}\")\n ctx.debug(\"Debug info\")\n ctx.warning(\"Warning message\")\n ctx.error(\"Error message\")\n\n # Report progress\n ctx.report_progress(50, 100)\n\n # Access resources\n data = ctx.read_resource(\"resource://data\")\n\n # Get request info\n request_id = ctx.request_id\n client_id = ctx.client_id\n\n return str(x)\n```\n\nThe context parameter name can be anything as long as it's annotated with Context.\nThe context is optional - tools that don't need it can omit the parameter.",
"properties": {},
"title": "Context",
"type": "object"
}
},
"properties": {
"ctx": {
"anyOf": [
{
"$ref": "#/$defs/Context"
},
{
"type": "null"
}
],
"default": null
},
"database": {
"title": "database",
"type": "string"
},
"password": {
"title": "password",
"type": "string"
},
"sql_query": {
"title": "sql_query",
"type": "string"
},
"username": {
"title": "username",
"type": "string"
},
"workspace_group_identifier": {
"title": "workspace_group_identifier",
"type": "string"
},
"workspace_identifier": {
"title": "workspace_identifier",
"type": "string"
}
},
"required": [
"workspace_group_identifier",
"workspace_identifier",
"database",
"sql_query",
"username",
"password"
],
"title": "execute_sqlArguments",
"type": "object"
}