Skip to main content
Glama

query_database

Retrieve and filter data from a Notion database using a specified ID and optional filters, integrated within the Multi-MCPs server for streamlined API access.

Instructions

Query a Notion database with optional filter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYes
filterNo

Implementation Reference

  • Handler function that validates inputs and calls the Notion client's queryDatabase method to execute the tool.
    async query_database(args: Record<string, unknown>) { if (!cfg.notionToken) throw new Error("NOTION_TOKEN is not configured"); const databaseId = String(args.database_id || ""); if (!databaseId) throw new Error("database_id is required"); return client.queryDatabase(databaseId, args.filter); },
  • Input schema defining the parameters for the query_database tool: database_id (required string) and optional filter object.
    inputSchema: { type: "object", properties: { database_id: { type: "string" }, filter: { type: "object" }, }, required: ["database_id"], },
  • Tool registration entry including name, description, and input schema within the registerNotion function.
    { name: "query_database", description: "Query a Notion database with optional filter", inputSchema: { type: "object", properties: { database_id: { type: "string" }, filter: { type: "object" }, }, required: ["database_id"], }, },
  • Helper method in NotionClient class that performs the actual API request to query a Notion database.
    queryDatabase(databaseId: string, filter?: unknown) { return this.request(`/v1/databases/${databaseId}/query`, { method: "POST", body: filter ? { filter } : {}, }); }

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/TaylorChen/muti-mcps'

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