Problem/Motivation

When working with content entities, it is often necessary to determine the bundle (e.g., content type for nodes, vocabulary for taxonomy terms) before performing further operations. Currently, there is no dedicated tool to retrieve just the bundle - users must load field values or inspect the entity manually (or in the prompt if using AI).

Proposed resolution

New tool plugin: EntityBundle

Input

The tool supports two input modes:

  • Loaded entity - pass an entity object directly (e.g., from a
    previous tool's output)
  • Entity type ID + Entity ID - pass entity_type_id and entity_id as a fallback when no loaded entity is available

Output

  • bundle (string) — the bundle machine name of the entity

Remaining tasks

MR and review

Issue fork tool_belt-3583475

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ajits created an issue. See original summary.

ajits’s picture

Status: Active » Needs review

Created a MR. Please review.

michaellander’s picture

Hi Ajits, would you see any value in maybe making this a little more broad and allow it to return more general metadata? Maybe align it to metadata available from other tools?

Is revision-able
Is translatable
Language
UUID

ajits’s picture

Title: Create a tool to get the bundle for the entity » Create a tool to get the metadata for the entity
ajits’s picture

@michaellander - I have expanded the scope for the tool. This works in my scenario for getting the bundle; and might help with others as well.

  • ajits committed 91a7980b on 1.0.x
    feat: #3583475 Create a tool to get the metadata for the entity
    
ajits’s picture

Status: Needs review » Fixed

@michaellander - I went ahead and merged this. I will fix any review points in follow-ups.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.