list_databases
Discover and access all available Notion databases to retrieve their IDs, titles, creation times, and archive status for integration setup.
Instructions
Lists all Notion databases accessible to the integration. Returns each database's ID, title, creation time, and archive status. Use this to discover available databases.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/presentation/mcp/MCPServer.ts:273-280 (registration)Registration of the 'list_databases' tool, including name, description, and empty input schema.{ name: 'list_databases', description: 'Lists all Notion databases accessible to the integration. Returns each database\'s ID, title, creation time, and archive status. Use this to discover available databases.', inputSchema: { type: 'object', properties: {}, }, },
- Primary handler for the 'list_databases' tool call, which executes the use case and formats the MCP response.private async handleListDatabases() { const result = await this.dependencies.listDatabasesUseCase.execute(); return { content: [ { type: 'text' as const, text: JSON.stringify( result.map((db) => ({ id: db.id.toString(), title: db.title, createdTime: db.createdTime, archived: db.archived, })), null, 2 ), }, ], };
- Use case class providing the core logic: delegates to database repository to list all databases.export class ListDatabasesUseCase { constructor(private readonly databaseRepository: IDatabaseRepository) {} async execute(): Promise<Database[]> { return await this.databaseRepository.findAll(); } }