tool
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.
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(WIP)
- Automatic token support (WIP)
- Form and schema altering based on usage (WIP)
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 comes packaged with tool_ai_connector to start using for AI function_calling right away. This also allows you to start using the module with MCP and AI Agents immediately. Direct integration with MCP is coming very soon, and then support for creating actions and using with ECA is to follow.
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.