Limit Parameter Now Prevents Important Flag Auto-Apply
Version Information
TypeScript/JavaScript
- Package:
@composio/coreand all provider packages - Version:
0.6.3+ - PR: #2570
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.
What Changed
Previously, when querying tools by toolkit with bothtoolkits 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:
Auto-Apply Logic
Theimportant flag is now auto-applied only when ALL of these conditions are met:
toolkitsis providedtoolsis NOT providedtagsis NOT providedsearchis NOT providedlimitis NOT provided ← NEWimportantis NOT explicitly set tofalse
Examples
Auto-Applies Important (No Limit)
Does NOT Auto-Apply (Limit Provided)
Explicit Important Overrides
Prevents Auto-Apply (Tags Provided)
Prevents Auto-Apply (Search Provided)
Why This Matters
When you provide alimit, 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:
- Pagination: Get exactly N tools per page
- Performance: Limit tool count for faster responses
- UI constraints: Display a specific number of tools in your interface
Backward Compatibility
This change is backward compatible with one caveat:- No code changes needed for most users
- If you were relying on automatic
importantfiltering withlimit, you now need to explicitly passimportant: true