Skip to main content
Glama

notion_retrieve_database

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

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

  • Handler case in the CallToolRequest switch that extracts arguments, casts to RetrieveDatabaseArgs, and delegates to NotionClientWrapper.retrieveDatabase
    case "notion_retrieve_database": {
      const args = request.params
        .arguments as unknown as args.RetrieveDatabaseArgs;
      response = await notionClient.retrieveDatabase(args.database_id);
      break;
    }
  • Defines the MCP Tool schema for notion_retrieve_database, including name, description, and input schema validation
    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"],
      },
    };
  • Core implementation in NotionClientWrapper that makes the GET request to Notion API /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();
    }
  • The tool schema is included in the allTools array used in the ListToolsRequest handler to register the tool with the MCP server
    schemas.retrieveDatabaseTool,
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states 'Retrieve' implying a read operation, but doesn't cover permissions, rate limits, error handling, or response format details. The input schema's 'format' parameter hints at output behavior, but the description itself lacks explicit disclosure.

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, direct sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential action without unnecessary elaboration.

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?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'retrieve' entails (e.g., returns database metadata, structure, or contents), response format implications, or how it differs from related tools, leaving significant gaps for agent understanding.

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 parameter semantics beyond what's in the schema, meeting the baseline for high coverage but not providing extra value like usage examples or edge cases.

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 action ('Retrieve') and resource ('a database in Notion'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'notion_retrieve_page' or 'notion_query_database', which also retrieve Notion content but target different resources or methods.

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. It doesn't mention sibling tools like 'notion_query_database' (for querying database contents) or 'notion_retrieve_page' (for retrieving pages), 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/suekou/mcp-notion-server'

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