Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/mcp-server-supabase/src/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4050,6 +4050,17 @@ describe('feature groups', () => {

expect(queryLogs?.description).toContain('ClickHouse');
expect(sqlDescription).toContain("log_attributes['<key>']");
// Edge Function logs are split across two ClickHouse sources. The hint must
// name both, or the model reaches for `function_edge_logs` (the request
// envelope) when the user asked for console output, which only lives in
// `function_logs`. See getClickHouseLogQuery in logs.ts.
expect(sqlDescription).toContain("'function_edge_logs'");
expect(sqlDescription).toContain("'function_logs'");
// The log line text lives in `event_message`; `log_attributes` carries only
// per-row metadata. Without naming the column the model reads
// `log_attributes`, finds no message key, and reports that the console
// output was never stored. See getClickHouseLogQuery in logs.ts.
expect(sqlDescription).toContain('event_message');
});

test('query_logs advertises the BigQuery dialect when the platform declares it', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const queryLogsByDialect = {
name: 'ClickHouse',
logsNoun: 'unified logs stream',
schemaHint:
"Logs are exposed through a `logs` table; filter by `source` (common values include 'edge_logs', 'postgres_logs', and 'function_edge_logs', but this list is not exhaustive — run `select distinct source from logs` to discover the sources available for this project) and read nested fields via `log_attributes['<key>']`.",
"Logs are exposed through a `logs` table; filter by `source` (common values include 'edge_logs', 'postgres_logs', 'function_edge_logs' for Edge Function invocation/request logs, and 'function_logs' for console output from inside an Edge Function, but this list is not exhaustive — run `select distinct source from logs` to discover the sources available for this project) and read the log line text from `event_message` (the console output or message body); `log_attributes['<key>']` holds only per-row metadata such as level, execution_id and status code.",
}),
bigquery: buildQueryLogsCopy({
name: 'BigQuery',
Expand Down