Schema Modifiers
Schema modifiers are part of Composio SDK’s powerful middleware capabilities that allow you to customize and extend the behavior of tools.
Schema Modifiers
Schema modifiers transform a tool’s schema before the tool is seen by an agent.

Useful for:
- Modifying or rewriting the tool description to better fit your use case.
- Adding arguments to the tool. For example, adding a
thought
argument to the tool to prompt the agent to explain the reasoning. - Hiding arguments from the tool. In cases where the argument is irrelevant to the tool.
- Adding extra arguments to the tool schema for custom use cases or execution.
- Adding default values to tool arguments.
Below we modify the schema of the HACKERNEWS_GET_LATEST_POSTS
to make the size
argument
required and remove the page
argument.
In using the above modified tool schema, the page
argument is removed and the size
argument is required.
You can test this out by viewing the tool call response in the LLM too!
Schema modified tool call
Example: Modifying the tool description
Sometimes you need to provide additional context to help the agent understand how to use a tool correctly. This example demonstrates modifying the description of the GITHUB_LIST_REPOSITORY_ISSUES
tool to specify a default repository when none is provided.
This approach is particularly useful when you want to guide the agent’s behavior without changing the tool’s underlying functionality.
In this example:
- We append additional instructions to the tool’s description
- The modified description tells the agent to use
composiohq/composio
as the default repository - This helps prevent errors when the agent forgets to specify a repository parameter