If you’re building an agent, we recommend using sessions instead. See Tools and toolkits for how sessions handle tool discovery and execution automatically.
- Modifying or truncating the output of the tool
- Converting the output to a different format before returning it to the agent

Below we use the
afterExecute modifier to truncate the output of HACKERNEWS_GET_USER and only return the karma of the user.With Chat Completions
Since completion providers don’t have a function execution step, Composio executes the tool call directly. The modifier is configured on thetools.execute method.
- Python
- TypeScript
With Agentic Frameworks
Agentic providers have a function execution step. The modifier is configured on thetools.get method which modifies the execution logic within the framework.
- Python
- TypeScript