Skip to main content
If you’re building an agent, we recommend using sessions instead. See Tools and toolkits for how sessions handle tool discovery and execution automatically.
Schema modifiers are part of Composio SDK’s powerful middleware capabilities that allow you to customize and extend the behavior of tools. Schema modifiers transform a tool’s schema before the tool is seen by an agent.
Schema Modifier
Useful for:
  • Modifying or rewriting the tool description to better fit your use case
  • Adding arguments to the tool (e.g., adding a thought argument to prompt the agent to explain reasoning)
  • Hiding arguments from the tool when they’re irrelevant
  • Adding extra arguments for custom use cases
  • Adding default values to tool arguments
Below we modify the schema of HACKERNEWS_GET_LATEST_POSTS to make the size argument required and remove the page argument.
With the modified tool schema, the page argument is removed and size is required.

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 GITHUB_LIST_REPOSITORY_ISSUES to specify a default repository.
This approach is 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

Next

Before execution modifiers