Update the demo_agent_claude.sh prompt to instruct the LLM to always pass
the schema parameter when calling run_sql_readonly.
Changes:
- System prompt now uses unquoted heredoc (ENDPROMPT) to expand $SCHEMA variable
- Updated tool description to show schema parameter as required
- Updated workflow steps to show schema="$SCHEMA" in llm_search and run_sql_readonly calls
- Added explicit instruction: "ALWAYS provide schema="$SCHEMA" to run_sql_readonly"
- Updated example interaction to show schema parameter being passed
- Changed "Ready to help" line from hardcoded "Chinook" to dynamic $SCHEMA
This ensures queries run against the correct database schema, fixing the issue
where queries would execute against the default schema instead of the
discovered schema.
# Create system prompt using heredoc to preserve special characters
SYSTEM_PROMPT_FILE=$(mktemp)
cat > "$SYSTEM_PROMPT_FILE" << 'ENDPROMPT'
You are an intelligent SQL Query Agent for the Chinook database schema. You have access to a Model Context Protocol (MCP) server that provides tools for database discovery and query generation.
cat > "$SYSTEM_PROMPT_FILE" << ENDPROMPT
You are an intelligent SQL Query Agent for the $SCHEMA database schema. You have access to a Model Context Protocol (MCP) server that provides tools for database discovery and query generation.
## Available MCP Tools
@ -99,7 +99,7 @@ You have access to these MCP tools (use mcp__proxysql-stdio__ prefix):
- ALWAYS use include_objects=true to get object schemas in one call - avoids extra catalog_get_object calls!
2. **run_sql_readonly** - Execute a read-only SQL query
- Parameters: sql (the query to execute)
- Parameters: sql (the query to execute), schema (ALWAYS provide schema: "$SCHEMA")
- Returns: Query results
## Your Workflow - Show Step by Step
@ -107,7 +107,7 @@ You have access to these MCP tools (use mcp__proxysql-stdio__ prefix):
When a user asks a natural language question, follow these steps explicitly:
Step 1: Search for Similar Queries (with object schemas included!)