Preparing for Tool API 1.0.0-rc1
When to Use
Use this before updating
drupal/tool, or when a Tool API deprecation notice appears. Only items with a@deprecatedmarker or a "removed from tool:1.0.0-rc1" notice in beta11 code are listed as removals. This page goes stale when rc1 ships.Version: applies to
drupal/tool1.0.0-beta11 (beta; no security advisory coverage). Paths are undermodules/contrib/tool/.
Removals Announced in Code
| Deprecated | Since | Replacement | Runtime notice | Issue |
|---|---|---|---|---|
multiple: TRUE on an input, an output, a map property, or a refined definition |
beta10 | ListInputDefinition / ListOutputDefinition |
E_USER_DEPRECATED |
#3583049 |
Declaring an output with a core ContextDefinition or an input definition class |
beta9 | An OutputDefinitionInterface class |
E_USER_DEPRECATED |
#3583050 |
hook_data_type_adapter_info_alter() |
beta4 | hook_tool_typed_data_adapter_info_alter() |
E_USER_DEPRECATED |
#3582963 |
Drupal\tool\ExecutableResultInterface (now an empty shell) |
beta4 | Drupal\tool\Tool\ToolInterface; Drupal\tool\ToolResultInterface for results |
None: @deprecated docblock only, so only static analysis reports it |
#3582964 |
Example notice:
// tool 1.0.0-beta11 src/Tool/ToolDefinition.php
@trigger_error(sprintf("Declaring the '%s' input with multiple: TRUE is deprecated in tool:1.0.0-beta10 and is removed from tool:1.0.0-rc1. Declare a ListInputDefinition instead. See https://git.drupalcode.org/project/tool/-/work_items/3583049", $name), E_USER_DEPRECATED);
@internal helpers that go with them: ListInputDefinition::fromMultiple(), OutputDefinition::fromContextDefinition().
What the rc1 Meta States
Issue #3582978 "[META] Path to 1.0.0-rc1" (open, last updated 2026-09-20) states an API freeze must land before the RC1 tag, and "Frozen at RC1: everything in src/". Its checkRequirements() line is out of date; see checkRequirements.
Steps
- Run your tests with deprecations shown, run static analysis for
ExecutableResultInterface, and grep formultiple: TRUEandContextDefinition(in tool attributes. - Convert to
List*Definitionand*OutputDefinitionclasses. - Rename any
hook_data_type_adapter_info_alter()implementation. - Replace
instanceof ExecutableResultInterfacewithToolInterfaceorToolResultInterface.
Common Mistakes
- Waiting for rc1 to convert → rc1 removes the conversion; declarations using
multiple: TRUEwill no longer be converted - Splitting constraints wrongly when converting a
multipledeclaration by hand →ListInputDefinition::fromMultiple()keepsCounton the list and moves every other constraint toitem_definition; do the same - Assuming nothing else changes → the API is not frozen until rc1; read each beta's release notes
See Also
- Input Definitions, Output Definitions → the replacement classes
- Reference:
modules/contrib/tool/src/Tool/ToolDefinition.php,modules/contrib/tool/src/ExecutableResultInterface.php,modules/contrib/tool/src/TypedData/Adapter/TypedDataAdapterManager.php,modules/contrib/tool/src/TypedData/ListInputDefinition.php