Skip to content

Commit c8ff3aa

Browse files
authored
Merge pull request #34 from hackclub/revert-4ed00a2673b4aaaa4554aab929ac
2 parents 4ed00a2 + 062c8fa commit c8ff3aa

3 files changed

Lines changed: 5 additions & 75 deletions

File tree

warehouse-mcp/db.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
from typing import List, Dict, Any, Optional
1010
from psycopg.rows import dict_row
1111
from psycopg_pool import AsyncConnectionPool
12-
from warehouse_docs import (
13-
UNIFIED_ANALYTICS_EVENTS_GUIDANCE,
14-
UNIFIED_ANALYTICS_EVENTS_SQL_EXAMPLES,
15-
)
1612

1713

1814
# SQL statements that are never allowed, even with read-only connection
@@ -431,13 +427,7 @@ async def describe_schema(
431427
return f"Schema '{schema_name}' not found or has no tables."
432428

433429
output_parts = [f"# Schema: {schema_name}\n"]
434-
if schema_name == "public_unified_analytics":
435-
output_parts.append(
436-
"\n## Signup Analytics Guidance\n"
437-
f"{UNIFIED_ANALYTICS_EVENTS_GUIDANCE}\n\n"
438-
f"{UNIFIED_ANALYTICS_EVENTS_SQL_EXAMPLES}\n"
439-
)
440-
current_size = sum(len(part.encode('utf-8')) for part in output_parts)
430+
current_size = len(output_parts[0])
441431
budget_exceeded = False
442432

443433
for table_row in tables:

warehouse-mcp/server.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import psycopg
3030
from db import get_database, init_database, close_database, SQLValidationError
3131
from cache import get_cache
32-
from warehouse_docs import UNIFIED_ANALYTICS_EVENTS_GUIDANCE
3332

3433
# Load environment variables
3534
load_dotenv()
@@ -245,8 +244,7 @@ async def list_tools() -> list[Tool]:
245244
description=(
246245
"Execute a read-only SQL query against the data warehouse. "
247246
"Returns a query_id for fetching more rows, plus a preview of results. "
248-
"Use LIMIT in your SQL for large tables. Max 10,000 rows cached per query.\n\n"
249-
f"Analytics guidance: {UNIFIED_ANALYTICS_EVENTS_GUIDANCE}"
247+
"Use LIMIT in your SQL for large tables. Max 10,000 rows cached per query."
250248
),
251249
inputSchema={
252250
"type": "object",
@@ -323,11 +321,8 @@ async def list_tools() -> list[Tool]:
323321
"List all available schemas in the data warehouse.\n\n"
324322
"Key schemas:\n"
325323
"- airtable_unified_ysws_projects_db: Shipped projects and NPS on programs\n"
326-
"- public_unified_analytics: User histories and events on users. "
327-
"Use public_unified_analytics.events for signups and signup sources; "
328-
"the first event per normalized email is the signup.\n"
329-
"- loops.audience: User profile fields (geocoded country, etc.); "
330-
"do not use loops.audience.source for signup/source attribution\n"
324+
"- public_unified_analytics: User histories and events on users\n"
325+
"- loops.audience: User profile fields (geocoded country, etc.)\n"
331326
"- public_hackatime_analytics: Coding activity (preferred over hackatime schema)"
332327
),
333328
inputSchema={
@@ -341,10 +336,7 @@ async def list_tools() -> list[Tool]:
341336
description=(
342337
"Get detailed documentation for a schema including tables, columns, "
343338
"and sample data. Limited to 1000 columns per table. "
344-
"Use list_columns for tables with more columns. "
345-
"For signup counts and signup sources, describe public_unified_analytics "
346-
"and query public_unified_analytics.events; the first event per normalized "
347-
"email is the signup."
339+
"Use list_columns for tables with more columns."
348340
),
349341
inputSchema={
350342
"type": "object",

warehouse-mcp/warehouse_docs.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)