Audit Export Tool API Hero Image

If you have ever wondered why a Drupal site ends up with content types that look like storage closets full of things no one remembers putting there, Audit Export has always been the tool to help you sort it out. And now it gets even better.

A recent update I pushed to Audit Export adds full Tool API integration through a new submodule called Audit Export Tool (audit_export_tool). All you have to do is enable it:

drush en audit_export_tool

Once enabled, the module exposes Audit Export functionality as typed, discoverable Tool API plugins. This allows every audit, both core and custom, to be executed programmatically, consumed by external systems, or utilized by AI modules that build upon the Tool API.

What You Get with Tool API Support

Audit Export Tool builds on the existing plugin architecture and uses Drupal’s Tool API system to provide tools for:

  • Listing audits
  • Retrieving audit definitions
  • Running audits
  • Fetching report data with pagination
  • Getting individual row data
  • Queueing audits
  • Exporting reports to CSV
  • Automatically generating derived tools for every audit plugin

This includes your custom audit plugins. If you create a custom audit, whether it targets custom entities, business rules, or site diagnostics, the Tool API integration automatically exposes it as a callable tool with no extra work required.

How This Can Be Used with AI

The Tool API was designed to be consumed by many types of systems, including AI-focused modules. A common example is the Model Context Protocol.

Here is how everything fits together:

  1. Audit Export Tool exposes audits as Tool API plugins.
  2. The Tool API module gives these plugins typed input and output definitions.
  3. The MCP module, if installed, discovers these tools and makes them available to AI agents.

Once MCP is present, AI clients can:

  • Discover available audits
  • Run audits on demand
  • Retrieve paginated results
  • Analyze or summarize findings

If you do not install MCP, nothing changes. You simply have a clean programmatic API. If you do install it, AI systems gain immediate access to your audit data.

A Quick Example

Here is what a Tool API or MCP client might send to fetch the content type audit:

{
  "tool": "audit-export-tool:tools_audit_export_derived___content_type_audit",
  "parameters": {
    "limit": 10,
    "page": 1
  }
}

Drupal returns a structured result set with no scraping or guesswork required.


Further Reading

If you want to explore the broader ecosystem around the Tool API and AI-driven automation in Drupal, here are a few helpful resources:

These modules extend what is possible with Audit Export by providing typed tool interfaces, AI connectivity, and automated agent workflows.