Skip to content

fix: add focused log filters#275

Open
zxyasfas wants to merge 1 commit into
supabase-community:mainfrom
zxyasfas:fix/log-filter-options
Open

fix: add focused log filters#275
zxyasfas wants to merge 1 commit into
supabase-community:mainfrom
zxyasfas:fix/log-filter-options

Conversation

@zxyasfas
Copy link
Copy Markdown

@zxyasfas zxyasfas commented May 6, 2026

Summary

This adds focused filtering controls to the get_logs tool so clients can reduce noisy log output before sending it back to the model. The tool now accepts a short time window, explicit ISO timestamp bounds, a row limit, and a text search term for common log fields.

Problem

get_logs previously always queried the last 24 hours with a fixed default query. On projects with many edge functions or high log volume, this makes debugging difficult because relevant entries can be buried under unrelated service output.

Changes

  • Added last_minutes, iso_timestamp_start, iso_timestamp_end, search, and limit parameters to get_logs.
  • Passed the new filtering options through the platform layer into the Management API log query.
  • Added searchable log predicates for service-specific fields such as event messages, request paths, auth metadata, and edge function identifiers.
  • Added unit coverage for generated log SQL and MCP tool option forwarding.

Fixes #173.

Validation

  • pnpm --filter @supabase/mcp-server-supabase typecheck
  • CI=true pnpm --filter @supabase/mcp-server-supabase exec vitest --project unit --run src/logs.test.ts src/server.test.ts -t "get logs|LogQuery"
  • pnpm exec biome check packages/mcp-server-supabase/src/logs.ts packages/mcp-server-supabase/src/logs.test.ts packages/mcp-server-supabase/src/platform/api-platform.ts packages/mcp-server-supabase/src/platform/types.ts packages/mcp-server-supabase/src/server.test.ts packages/mcp-server-supabase/src/tools/debugging-tools.ts

The full Windows unit run still has existing path-related failures in edge-function.test.ts / edge-function server assertions, unrelated to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New get_logs tool parameters to reduce context bloat

1 participant