Before Execution Modifiers
Learn how to use before execution modifiers to modify tool arguments before execution.
Before execution modifiers are part of Composio SDK’s powerful middleware capabilities that allow you to customize and extend the behavior of tools.
Before Execution Modifiers
These modifiers are called before the tool is executed by the LLM. This allows you to modify the arguments called by the LLM before they are executed by Composio.
Useful for:
- Injecting an argument into the tool execution.
- Overriding the arguments emitted by the LLM.

Below we use the beforeExecute
modifier to modify the number of posts returned by the
HACKERNEWS_GET_LATEST_POSTS
tool.
With Chat Completions
With Agentic Frameworks
Since completion providers don’t have a function execution step — Composio will execute the tool call directly.
Hence, the modifier is configured on the tools.execute
method.