Skip to main content
Glama
peximo
by peximo

get_node

Retrieve complete details of a specific Drupal node by providing its content type and ID. Fetch node information including related entities like images and authors for content management.

Instructions

Retrieve complete details of a specific Drupal node by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeTypeYesThe machine name of the content type (e.g., "article", "page", "blog_post")
nodeIdYesThe UUID or numeric ID of the node
includeNoRelated entities to include (e.g., ["field_image", "uid"] to include image and author)

Implementation Reference

  • The actual implementation of the get_node tool functionality in the DrupalClient class.
    async getNode(
        contentType: string,
        nodeId: string,
        include: string[] = []
    ): Promise<DrupalNode> {
        try {
            const params: any = {};
    
            // Include related entities if requested
            // Example: ['field_image', 'uid'] to include image and author
            if (include.length > 0) {
                params.include = include.join(',');
            }
    
            const response = await this.client.get<JsonApiResponse>(
                `/node/${contentType}/${nodeId}`,
                { params }
            );
    
            // JSON:API returns single resource as object, not array
            return response.data.data as DrupalNode;
        } catch (error: any) {
            if (error.response?.status === 404) {
                throw new Error(`Node ${nodeId} not found`);
            }
            throw new Error(`Failed to get node: ${error.message}`);
        }
    }
  • The MCP tool handler that routes the 'get_node' request to the DrupalClient method.
    case 'get_node': {
        const typedArgs = args as unknown as GetNodeArgs;
        const node = await drupalClient.getNode(
            typedArgs.nodeType,
            typedArgs.nodeId,
            typedArgs.include || []
        );
    
        // Return full node data
        return {
            content: [
                {
                    type: 'text',
                    text: JSON.stringify(node, null, 2),
                },
            ],
        };
    }
  • src/index.ts:68-90 (registration)
    Registration of the 'get_node' tool, including its schema definitions.
    {
        name: 'get_node',
        description: 'Retrieve complete details of a specific Drupal node by its ID',
        inputSchema: {
            type: 'object',
            properties: {
                nodeType: {
                    type: 'string',
                    description: 'The machine name of the content type (e.g., "article", "page", "blog_post")',
                },
                nodeId: {
                    type: 'string',
                    description: 'The UUID or numeric ID of the node',
                },
                include: {
                    type: 'array',
                    items: { type: 'string' },
                    description: 'Related entities to include (e.g., ["field_image", "uid"] to include image and author)',
                },
            },
            required: ['nodeType', 'nodeId'],
        },
    },
Behavior2/5

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

No annotations provided, so description carries full burden. States 'complete details' but doesn't clarify what is included by default, error behavior if node doesn't exist, authentication requirements, or whether this operation is read-only and safe (though implied by 'Retrieve').

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?

Single 10-word sentence that front-loads the verb. No redundancy or filler. Efficiently conveys core purpose without waste.

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 simple retrieval tool with well-documented schema, but gaps remain: no output schema means description should hint at return structure (fields, revisions), and complete absence of behavioral annotations leaves agent without safety/permission 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?

With 100% schema coverage, baseline is 3. Description mentions 'by its ID' which maps to nodeId, but adds no semantic context for nodeType expectations or the include parameter's relationship to field API names 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?

States specific action (Retrieve) and resource (Drupal node details) with clear scope (specific node by ID). Implicitly distinguishes from siblings via 'specific' and 'by its ID' versus query/search operations, though explicit differentiation is absent.

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 alternatives like query_content or search_content. Does not mention prerequisites (e.g., needing the node ID from prior search) or when to prefer listing content types first.

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