Skip to main content
Glama

get_database

Retrieve detailed information about a Notion database including title, schema, property definitions, and timestamps to understand its structure and contents.

Instructions

Retrieves detailed information about a specific Notion database by its ID. Returns database title, schema (property definitions), creation time, last edited time, and more. Use this to understand database structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseIdYesThe ID of the Notion database to retrieve (32 or 36 character UUID format). Example: "123e4567-e89b-12d3-a456-426614174000"

Implementation Reference

  • Core execution logic for the get_database tool. Converts input databaseId to DatabaseId value object and delegates to repository to fetch the database.
    export class GetDatabaseUseCase {
      constructor(private readonly databaseRepository: IDatabaseRepository) {}
    
      async execute(input: GetDatabaseInput): Promise<Database | null> {
        const databaseId = new DatabaseId(input.databaseId);
        return await this.databaseRepository.findById(databaseId);
      }
    }
  • Registers the 'get_database' tool with the MCP server, including name, description, and input schema validation.
    {
      name: 'get_database',
      description: 'Retrieves detailed information about a specific Notion database by its ID. Returns database title, schema (property definitions), creation time, last edited time, and more. Use this to understand database structure.',
      inputSchema: {
        type: 'object',
        properties: {
          databaseId: {
            type: 'string',
            description: 'The ID of the Notion database to retrieve (32 or 36 character UUID format). Example: "123e4567-e89b-12d3-a456-426614174000"',
          },
        },
        required: ['databaseId'],
      },
    },
  • MCP server handler method that invokes the GetDatabaseUseCase and formats the response as JSON or handles not found.
    private async handleGetDatabase(args: any) {
      const result = await this.dependencies.getDatabaseUseCase.execute({
        databaseId: args.databaseId,
      });
    
      if (!result) {
        return {
          content: [
            {
              type: 'text' as const,
              text: 'Database not found',
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(
              {
                id: result.id.toString(),
                title: result.title,
                schema: result.schema,
                createdTime: result.createdTime,
                lastEditedTime: result.lastEditedTime,
                archived: result.archived,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Dependency injection factory method that instantiates the GetDatabaseUseCase with the NotionDatabaseRepository.
    getGetDatabaseUseCase(): GetDatabaseUseCase {
      return new GetDatabaseUseCase(this.databaseRepository);
    }
  • Type definition for input to the GetDatabaseUseCase, matching the tool schema.
    export interface GetDatabaseInput {
      databaseId: string;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly indicates this is a read operation ('Retrieves'), which is helpful. However, it doesn't mention authentication requirements, rate limits, error conditions, or whether the database must be accessible to the user. The description adds some behavioral context but leaves important operational details unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences that each earn their place. The first sentence states the purpose and what's returned, while the second provides clear usage guidance. There's zero wasted language or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read operation with no output schema, the description provides good coverage of purpose, return values, and usage context. It could be more complete by mentioning authentication or error handling, but given the tool's simplicity and the absence of annotations/output_schema, it's reasonably comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already fully documents the single parameter (databaseId with format examples). The description adds no additional parameter information beyond what's in the schema, so it meets the baseline for high schema coverage without adding extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieves detailed information'), target resource ('specific Notion database by its ID'), and distinguishes from siblings like list_databases (which lists databases) and get_page (which retrieves page information). It provides concrete details about what information is returned.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('to understand database structure'), which implicitly distinguishes it from siblings like list_databases (for listing databases) and query_pages (for querying database contents). However, it doesn't explicitly state when NOT to use it or name specific alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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