A pluggable API for defining executable logic with typed Inputs and Outputs.

The Tool API module provides a modern, typed, and extensible framework for defining executable units of logic in Drupal. Think of it as a next-generation replacement for core Actions—but with clear input/output schemas, less ambiguity, and designed to be reused across different systems.

Tools are defined with typed Inputs and Outputs, making them easy to validate, document, and reuse. They can power everything from workflow engines to AI agents, or simply provide cleaner APIs for developers who need to expose functionality in a structured way. Tools are expected to be usable completely from configuration or from arguments passed at call time, or with a mix of both.

Where'd the tools go?

You may notice the default tools are gone from Tool API. This was intentional to allow for the community to build their own sets of tools over time. To access the previous curated collection of core tools, checkout Tool Belt, which provides the same tools you may have been accustomed to in alpha and will continue to grow.

We encourage module maintainers to provide tools in your own modules, and also share collections of other tools you've had success with.

Why Tool API?

Drupal’s current Actions API is useful but limited:

  • Input is loosely defined, outputs are non-existent.
  • Inputs, Form and Configuration are all 'defined' separately, without anything binding them together.
  • Extending Actions for new use cases (e.g., AI integration, automation engines) is difficult.

Tool API addresses these problems by:

  • Inputs and Outputs, and Results message built into the contract
  • Using ContextDefinition-style typed data to make every tool self-describing
  • Allowing hierarchical/nested definitions to cover complex use cases.
  • Forms and config schema automatically generated from Input Definitions

Use Cases

  • Developers: expose custom functionality as reusable Tools instead of writing custom Actions/Conditions.
  • Workflow Builders: plug Tools into ECA or Rules-style engines with clear input/output schemas.
  • AI Integrations: Tools can be exported as JSON Schema for use in OpenAI/Anthropic tool-calling, allowing Drupal functionality to be safely invoked by AI agents.
  • Site Builders: more predictable and validated Actions when building automations.

Roadmap

Tools can now be used across AI Agents (using thetool_ai_connector submodule) and MCP. Support for ECA is being worked on and should be coming very soon.

I'm also working on a Tool Refiner module that will allow users to define preconfigured versions of existing tools with some values preset and/or additional constraints added. This allows you to expose specialist versions of tools to other modules without having to make a tools full unrestricted capabilities available.

Supporting this Module

Creation of this module and my work toward the AI initiative have been split between donating my own time and supporting organizations. If you are interested in supporting my efforts, please reach out through direct message or Drupal slack.

Supporting organizations: 
Sponsored part of initial development.

Project information

Releases