Skip to main content

Limit Parameter Now Prevents Important Flag Auto-Apply

Version Information

TypeScript/JavaScript

  • Package: @composio/core and all provider packages
  • Version: 0.6.3+
  • PR: #2570
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.

What Changed

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:
After:

Auto-Apply Logic

The important flag is now auto-applied only when ALL of these conditions are met:
  • toolkits is provided
  • tools is NOT provided
  • tags is NOT provided
  • search is NOT provided
  • limit is NOT provided ← NEW
  • important is NOT explicitly set to false

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 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:
  1. Pagination: Get exactly N tools per page
  2. Performance: Limit tool count for faster responses
  3. 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 important filtering with limit, you now need to explicitly pass important: true
Migration (if needed):

Documentation

Full documentation with more examples is available in the Tools API Reference.