Problem/Motivation

Let's add a Tool API plugin so that people can interact with the module using their AI of choice.

Proposed resolution

Create a Tool API plugin that exposes information from the public method EntityUsageInterface::listSources()

Remaining tasks

- Should we expose something else?
- Is "list sources" suitable terminology for this context? ( entity_usage:list_sources for the plugin machine name)

CommentFileSizeAuthor
#3 usage_in_claude_code.png288.81 KBmarcoscano
#3 ui_usage.png178.24 KBmarcoscano
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

marcoscano created an issue. See original summary.

marcoscano’s picture

StatusFileSize
new178.24 KB
new288.81 KB

With the help of the LLM I've put together a first attempt at this.

Still testing, but so far it looks to be doing what it's expected:

UI Usage

Claude Code usage

marcoscano’s picture

Assigned: marcoscano » Unassigned
Status: Active » Needs review

Did some refactoring.
We mentioned in slack that having "display logic" duplicated between the controller and the tool plugin was suboptimal, and it could make sense to extract that into a separate service. The new version of the MR does that, at the cost of increasing the size of it to a non-negligible refactor. I hope it all makes sense.

(I was hitting a few flaky tests that seem to be fixed with the adjustments made. Unrelated but didn't seem too big of a deal so I included the fix here.)