Skip to main content
Glama

list_databases

Discover all accessible Notion databases with their IDs, titles, creation times, and archive status to identify available data sources for integration.

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The handler function for the 'list_databases' MCP tool. It executes the ListDatabasesUseCase and formats the JSON response containing database IDs, titles, creation times, and archive status.
    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 ), }, ], }; }
  • Registration of the 'list_databases' tool in the MCP server's tool list, including name, description, and empty input schema (no parameters required).
    { 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: {}, }, },
  • Input schema definition for the 'list_databases' tool, specifying an empty object (no input parameters needed).
    inputSchema: { type: 'object', properties: {}, },
  • The use case implementing the core business logic for listing databases by calling the repository's findAll method.
    export class ListDatabasesUseCase { constructor(private readonly databaseRepository: IDatabaseRepository) {} async execute(): Promise<Database[]> { return await this.databaseRepository.findAll(); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Kazy1014/notion-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server