## Problem
The read-only notebook tools (`list_databases`, `list_notebooks`,
`get_notebook`) are still defined inline with `tool({...})`. The other
AI tools have moved to the tool contract pattern, so these three are
inconsistent with the rest.
## Solution
Migrate the three tools to the tool contract pattern: a contract file
plus a `.server.ts` implementation, registered in `TOOL_CONTRACTS`. They
are removed from `TOOL_CATEGORY_MAP` and kept in the allowlist.
Behavior is unchanged:
- `minOptInLevel: 'schema'`, same as before.
- `needsApproval: false`.
- `toModelOutput` returns the output unchanged, so the model sees the
same data at every opt-in level.
Stored-shape changes for replayed outputs:
- Replayed outputs are now validated against the output schema and
dropped if invalid. Previously they passed through unchecked.
- Zod strips unknown keys, so fields outside the schema no longer
replay.
- `status`, `region`, and `visibility` use plain `z.string()`, so new
enum values do not break replay.
## Review instructions
1. Run `pnpm exec vitest run lib/ai` in `apps/studio`. It should pass
(323 tests).
2. In `apps/studio/lib/ai/tools/registry.test.ts`, check the new
coverage: `toModelOutput` at all four opt-in levels, for both live and
replayed outputs, and invalid replayed outputs being dropped.
3. Confirm the three tools still appear for the schema opt-in level in
`tool-filter.test.ts` and `notebook-tools.test.ts`.
## Checklist
Check all before review:
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)