docs/content/changelog/02-04-26-limit-prevents-important-auto-apply.mdx
@composio/core and all provider packages0.6.3+The important flag auto-apply logic has been updated to respect the limit parameter. When you provide a limit, the SDK no longer automatically applies important: true, ensuring you get the exact number of tools you requested.
Previously, when querying tools by toolkit with both toolkits and limit parameters, the SDK would auto-apply important: true. This could result in returning fewer tools than the requested limit if the toolkit had limited important tools.
Before:
// @noErrors
// Could return < 50 tools if only 10 important tools exist
const tools = await composio.tools.get('default', {
toolkits: ['github'],
limit: 50,
});
// Result: Only 10 tools (important ones only)
After:
// @noErrors
// Returns exactly 50 tools (or all available if < 50)
const tools = await composio.tools.get('default', {
toolkits: ['github'],
limit: 50,
});
// Result: 50 tools (including non-important)
The important flag is now auto-applied only when ALL of these conditions are met:
toolkits is providedtools is NOT providedtags is NOT providedsearch is NOT providedlimit is NOT provided ← NEWimportant is NOT explicitly set to false// @noErrors
const tools = await composio.tools.get('default', {
toolkits: ['github'],
});
// Returns: ~10-20 important tools
// @noErrors
const tools = await composio.tools.get('default', {
toolkits: ['github'],
limit: 50,
});
// Returns: Exactly 50 tools (or all available)
// @noErrors
const tools = await composio.tools.get('default', {
toolkits: ['github'],
limit: 50,
important: true,
});
// Returns: Up to 50 important tools
// @noErrors
const tools = await composio.tools.get('default', {
toolkits: ['github'],
tags: ['important'],
});
// Returns: GitHub tools with 'important' tag (no auto-apply)
// @noErrors
const tools = await composio.tools.get('default', {
toolkits: ['github'],
search: 'repository',
});
// Returns: GitHub tools matching search (no auto-apply)
When you provide a limit, you're explicitly requesting a specific number of tools. Auto-applying the important filter could prevent you from getting the requested number of tools. This change respects user intent and makes the SDK behavior more predictable.
Use cases:
This change is backward compatible with one caveat:
important filtering with limit, you now need to explicitly pass important: trueMigration (if needed):
// @noErrors
// Before (relied on auto-apply even with limit)
const tools = await composio.tools.get('default', {
toolkits: ['github'],
limit: 20,
});
// After (explicit important flag)
const tools = await composio.tools.get('default', {
toolkits: ['github'],
limit: 20,
important: true, // Explicitly set if you want important tools
});
Full documentation with more examples is available in the Tools API Reference.