Skip to main content
Glama
peximo
by peximo

query_content

Search and filter Drupal content by type, title, or publication status to find specific nodes in your Drupal site.

Instructions

Search and filter Drupal content by type. Returns a list of nodes matching the criteria.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentTypeYesThe machine name of the content type (e.g., "article", "page", "blog_post")
limitNoMaximum number of results to return (default: 10)
titleNoFilter by title (partial match)
statusNoFilter by publication status (true = published, false = unpublished)

Implementation Reference

  • The handler function that executes the query_content tool logic by fetching content from Drupal's JSON:API.
    async queryContent(
        contentType: string,
        options: {
            limit?: number | undefined;
            title?: string | undefined;
            status?: boolean | undefined;
        } = {}
    ): Promise<DrupalNode[]> {
        try {
            // Build query parameters for JSON:API
            const params: any = {
                'page[limit]': options.limit || 10,
            };
    
            // Add filters if provided
            const filters: string[] = [];
            if (options.title) {
                params['filter[title][operator]'] = 'CONTAINS';
                params['filter[title][value]'] = options.title;
            }
            if (options.status !== undefined) {
                params['filter[status]'] = options.status ? '1' : '0';
            }
    
            // Make the request to JSON:API
            const response = await this.client.get<JsonApiResponse>(
                `/node/${contentType}`,
                { params }
            );
    
            // Return array of nodes (handle both single and multiple results)
            return Array.isArray(response.data.data)
                ? response.data.data
                : [response.data.data];
        } catch (error: any) {
            throw new Error(`Failed to query content: ${error.message}`);
        }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the return value ('list of nodes') but omits safety confirmations (read-only status), pagination behavior beyond the limit parameter, and error handling for invalid content types.

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?

Two efficient sentences with zero waste. The first sentence front-loads the purpose, while the second explains the return value—essential information given the absence of an output schema.

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

Completeness3/5

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

Adequate for a 4-parameter query tool with full schema coverage, but gaps remain. The description fails to clarify the relationship to 'search_content' (likely full-text vs structured filtering) and assumes familiarity with Drupal 'nodes' without context.

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 coverage is 100%, establishing a baseline of 3. The description mentions filtering 'by type' which aligns with the contentType parameter, but adds no semantic detail for the title, status, or limit parameters beyond what the schema already provides.

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?

Clear verb+resource ('Search and filter Drupal content') and specifies the filtering dimension ('by type'). However, it does not explicitly differentiate from sibling tool 'search_content', leaving ambiguity about when to choose this over alternatives.

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?

Provides no guidance on when to use this tool versus siblings ('search_content', 'get_node', 'list_content_types'). No prerequisites, exclusions, or workflow context is mentioned.

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/peximo/drupal-mcp-server'

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