Skip to main content
Glama
TaylorChen

Multi-MCPs

by TaylorChen

query_database

Retrieve and filter data from Notion databases to extract specific information for analysis or integration.

Instructions

Query a Notion database with optional filter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYes
filterNo

Implementation Reference

  • The main handler function for the 'query_database' tool. It validates the Notion token and database_id, then delegates to the NotionClient's queryDatabase method.
    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 for the 'query_database' tool, defining required 'database_id' string and optional 'filter' object.
    inputSchema: {
      type: "object",
      properties: {
        database_id: { type: "string" },
        filter: { type: "object" },
      },
      required: ["database_id"],
    },
  • Registration of the 'query_database' tool within the tools array in 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 makes the actual Notion API request to query the specified database.
    queryDatabase(databaseId: string, filter?: unknown) {
      return this.request(`/v1/databases/${databaseId}/query`, {
        method: "POST",
        body: filter ? { filter } : {},
      });
    }
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. It states the tool queries a database but doesn't describe what the query returns, any rate limits, authentication requirements, or error conditions. For a tool with no annotation coverage, this is a significant gap in transparency.

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 with no wasted words. It's front-loaded with the core purpose and includes key details like the resource and optional parameter. Every part of the sentence contributes meaning.

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 the tool's complexity (querying a database with nested objects), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain return values, error handling, or provide enough context for the agent to use it effectively without additional information.

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

Parameters2/5

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

Schema description coverage is 0%, meaning the schema provides no descriptions for the parameters. The description mentions 'optional filter' but doesn't explain what 'database_id' is or provide details on filter structure or usage. It adds minimal value beyond the schema, failing to compensate for the coverage gap.

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 ('Query') and resource ('a Notion database'), making the purpose understandable. It specifies the optional filter parameter, which adds some detail. However, it doesn't distinguish this tool from potential siblings like 'search_pages' or 'get_boards' that might also query databases, so it lacks sibling differentiation.

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 prerequisites, such as needing a database ID, or compare it to other query-related tools in the sibling list. This leaves the agent with no explicit usage context.

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

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