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'],
        },
    },

Tool Definition Quality

Score is being calculated. Check back soon.

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