Skip to main content
Glama

notion_retrieve_database

Retrieve Notion database content in JSON or Markdown format for reading, writing, or modifying data within Claude Desktop.

Instructions

Retrieve a database in Notion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYesThe ID of the database to retrieve.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-).
formatNoSpecify the response format. 'json' returns the original data structure, 'markdown' returns a more readable format. Use 'markdown' when the user only needs to read the page and isn't planning to write or modify it. Use 'json' when the user needs to read the page with the intention of writing to or modifying it.markdown

Implementation Reference

  • Core handler function that executes the tool logic by performing a GET request to the Notion API endpoint /databases/{database_id} to retrieve the database.
    async retrieveDatabase(database_id: string): Promise<DatabaseResponse> {
      const response = await fetch(`${this.baseUrl}/databases/${database_id}`, {
        method: "GET",
        headers: this.headers,
      });
    
      return response.json();
    }
  • MCP server handler switch case that processes the CallToolRequest for notion_retrieve_database, validates args, and delegates to NotionClientWrapper.
    case "notion_retrieve_database": {
      const args = request.params
        .arguments as unknown as args.RetrieveDatabaseArgs;
      response = await notionClient.retrieveDatabase(args.database_id);
      break;
  • JSON schema definition for the tool's input parameters, metadata, and description.
    export const retrieveDatabaseTool: Tool = {
      name: "notion_retrieve_database",
      description: "Retrieve a database in Notion",
      inputSchema: {
        type: "object",
        properties: {
          database_id: {
            type: "string",
            description:
              "The ID of the database to retrieve." + commonIdDescription,
          },
          format: formatParameter,
        },
        required: ["database_id"],
      },
    };
  • Registers the tool in the MCP server's ListToolsRequestHandler by including it in the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      const allTools = [
        schemas.appendBlockChildrenTool,
        schemas.retrieveBlockTool,
        schemas.retrieveBlockChildrenTool,
        schemas.deleteBlockTool,
        schemas.updateBlockTool,
        schemas.retrievePageTool,
        schemas.updatePagePropertiesTool,
        schemas.listAllUsersTool,
        schemas.retrieveUserTool,
        schemas.retrieveBotUserTool,
        schemas.createDatabaseTool,
        schemas.queryDatabaseTool,
        schemas.retrieveDatabaseTool,
        schemas.updateDatabaseTool,
        schemas.createDatabaseItemTool,
        schemas.createCommentTool,
        schemas.retrieveCommentsTool,
        schemas.searchTool,
      ];
      return {
        tools: filterTools(allTools, enabledToolsSet),
      };
  • TypeScript type definition for the tool's input arguments used in the server handler.
    export interface RetrieveDatabaseArgs {
      database_id: string;
      format?: "json" | "markdown";
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'retrieve' implies a read operation, the description doesn't specify whether this requires authentication, rate limits, pagination behavior, or error conditions. It also doesn't describe the return format beyond what's implied by the 'format' parameter in the schema.

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 a single, efficient sentence that states the core purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given that there are no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like authentication needs, rate limits, or what the return data looks like (beyond format options). For a tool that retrieves structured data, more context about the response would be helpful.

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?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional meaning about parameters beyond what's already in the schema (e.g., it doesn't explain database_id format or format usage beyond the enum descriptions). This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('retrieve') and resource ('a database in Notion'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'notion_retrieve_page' or 'notion_retrieve_block', which follow the same pattern for different resources.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't explain how this differs from 'notion_query_database' (which likely searches within databases) or 'notion_retrieve_page' (which retrieves pages rather than databases), leaving the agent to infer usage from tool names alone.

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/kimjungyeol/mcp-notion-server'

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