Skip to main content
Glama
johnreitano

MCP Datastore Server

by johnreitano

datastore_query

Execute queries on Google Cloud Datastore entities with optional filters, pagination, and equality conditions to retrieve specific data sets efficiently.

Instructions

Execute a query on entities with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYesThe entity kind to query
limitNoMaximum number of results to return (default: 100)
offsetNoNumber of results to skip (default: 0)

Implementation Reference

  • The main handler function that executes the datastore_query tool logic, creating and running a Google Cloud Datastore query for the given kind with optional limit and offset.
    async queryEntities(kind: string, limit = 100, offset = 0): Promise<any[]> {
      try {
        const query = this.datastore.createQuery(kind)
          .limit(limit)
          .offset(offset);
    
        const [entities] = await this.datastore.runQuery(query);
        
        return entities.map(entity => ({
          key: entity[this.datastore.KEY],
          ...entity,
        }));
      } catch (error) {
        throw new Error(`Failed to query entities: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Input schema and metadata definition for the datastore_query tool, used in ListTools response.
    {
      name: 'datastore_query',
      description: 'Execute a query on entities with optional filters',
      inputSchema: {
        type: 'object',
        properties: {
          kind: {
            type: 'string',
            description: 'The entity kind to query',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results to return (default: 100)',
          },
          offset: {
            type: 'number',
            description: 'Number of results to skip (default: 0)',
          },
        },
        required: ['kind'],
      },
    },
  • src/index.ts:166-179 (registration)
    Dispatches the CallToolRequest for datastore_query to the queryEntities handler and formats the response.
    case 'datastore_query':
      const results = await datastoreClient.queryEntities(
        args.kind as string,
        args.limit as number | undefined,
        args.offset as number | undefined
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(results, null, 2),
          },
        ],
      };
Behavior2/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 mentions 'optional filters' but doesn't explain what types of filters are supported, how queries are executed (e.g., syntax, performance), or what the output looks like (e.g., format, pagination). This leaves significant gaps for a query tool, making it inadequate for safe and effective use.

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 directly states the tool's function without unnecessary words. It's front-loaded with the core action, making it easy to parse quickly, though it lacks depth due to its brevity.

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 complexity of a query tool with no annotations and no output schema, the description is incomplete. It fails to explain key aspects like query syntax, filter options, result format, or error handling, leaving the agent with insufficient context to use the tool effectively. This is a significant gap for a tool with multiple parameters and sibling alternatives.

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 input schema already documents all parameters (kind, limit, offset) with descriptions. The description adds no additional meaning beyond implying filtering capabilities, which doesn't compensate for any gaps. This meets the baseline for high schema coverage but doesn't enhance understanding.

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

Purpose3/5

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

The description states the action ('Execute a query') and target ('on entities'), which clarifies the basic purpose. However, it's vague about what 'query' entails compared to siblings like datastore_filter or datastore_list_kinds, lacking specific differentiation. It doesn't fully distinguish itself from alternatives, keeping it at a minimal viable level.

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 siblings such as datastore_count, datastore_filter, datastore_get, or datastore_list_kinds. It mentions 'optional filters' but doesn't specify contexts or exclusions, leaving the agent with no usage direction beyond the basic action.

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

Related 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/johnreitano/daisy'

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