ComposioHQ/composio · error · ValidationError
Invalid tool list parameters. You should not use tools and t
Error message
Invalid tool list parameters. You should not use tools and toolkits filter together.
What it means
ValidationError thrown by getRawComposioTools when the query object contains both 'tools' and 'toolkits' filters simultaneously. The backend cannot combine both filters, so the SDK rejects the combination up front.
Source
Thrown at ts/packages/core/src/models/Tools.ts:493
*
* // Search for tools
* const searchResults = await composio.tools.getRawComposioTools({
* search: 'user management'
* });
*
* // Get tools by authentication config
* const authSpecificTools = await composio.tools.getRawComposioTools({
* authConfigIds: ['auth_config_123']
* });
* ```
*/
async getRawComposioTools(
query: ToolListParams,
options?: SchemaModifierOptions,
requestOptions?: ComposioRequestOptions
): Promise<ToolList> {
if ('tools' in query && 'toolkits' in query) {
throw new ValidationError(
'Invalid tool list parameters. You should not use tools and toolkits filter together.'
);
}
const queryParams = ToolListParamsSchema.safeParse(query);
if (queryParams.error) {
throw new ValidationError('Invalid tool list parameters', {
cause: queryParams.error,
});
}
const shouldAutoApplyImportant =
'toolkits' in queryParams.data &&
!('tools' in queryParams.data) &&
!('tags' in queryParams.data) &&
!('search' in queryParams.data) &&
// if the user provides a limit, do not apply the important flag
!('limit' in queryParams.data) &&View on GitHub (pinned to 64b1b85502)
Solutions
- Use only one of tools or toolkits in the query
- If dynamic, delete keys whose value is undefined/empty before passing
- Use search or authConfigIds as additional filters instead of combining tools+toolkits
Example fix
// before
composio.tools.get({ tools: ['github_star_repo'], toolkits: ['github'] })
// after
composio.tools.get({ tools: ['github_star_repo'] }) Defensive patterns
Strategy: validation
Validate before calling
const q: ToolListParams = {};
if (slugs) q.tools = slugs; else if (toolkitSlugs) q.toolkits = toolkitSlugs; // never both Type guard
const hasBothFilters = (q: object): q is { tools: unknown; toolkits: unknown } => 'tools' in q && 'toolkits' in q; Try / catch
try { await composio.tools.get(query); } catch (e) { if (e instanceof ValidationError && /tools and toolkits/.test(e.message)) dropOneFilter(query); else throw e; } Prevention
- Build filter objects with if/else so keys are mutually exclusive
- Delete empty/undefined keys before passing queries
When it happens
Trigger: Calling composio.tools.get({ tools: ['github_star_repo'], toolkits: ['github'] }) or getRawComposioTools with both keys present, including keys set to undefined via spread/destructuring.
Common situations: Building filter objects dynamically where both keys get set, merging config objects, porting code that assumed filters were ANDed.
Related errors
- Invalid tool list parameters
- Invalid tool list parameters, atleast one of the following p
- experimental_subAgent() target must be "claude", "codex", or
- Invalid Composio CLI release tag: ${releaseTag}
- Invalid
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/852cac14a88ebe0f.
Report an issue: GitHub.