ComposioHQ/composio · error · ValidationError

Invalid tool list parameters

Error message

Invalid tool list parameters

What it means

ValidationError (with the Zod error as cause) thrown when the query passed to getRawComposioTools fails ToolListParamsSchema.safeParse. This means structurally invalid values: wrong types for tools/toolkits/search/limit, unknown shapes, etc.

Source

Thrown at ts/packages/core/src/models/Tools.ts:500

   * 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) &&
      queryParams.data.important !== false;

    const effectiveImportant =
      'important' in queryParams.data ? queryParams.data.important : shouldAutoApplyImportant;

    // check if the query params contains atleast one of the following: tools, toolkits, search, authConfigIds
    if (!(

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Inspect e.cause (the Zod error) for the exact failing field
  2. Pass tools/toolkits as string arrays and limit as a number
  3. If consuming external JSON, pre-validate with ToolListParamsSchema or your own Zod schema

Example fix

// before
composio.tools.get({ tools: 'github_star_repo' })
// after
composio.tools.get({ tools: ['github_star_repo'] })
Defensive patterns

Strategy: validation

Validate before calling

import { ToolListParamsSchema } from '@composio/core';
const parsed = ToolListParamsSchema.safeParse(query);
if (!parsed.success) console.error(parsed.error.issues);

Type guard

const isToolListParams = (q: unknown) => ToolListParamsSchema.safeParse(q).success;

Try / catch

try { await composio.tools.get(query); } catch (e) { if (e instanceof ValidationError && e.cause) console.error(e.cause.issues); throw e; }

Prevention

When it happens

Trigger: Passing a non-string in the tools array, a string where an array is expected, limit as a non-number, or a malformed query object to composio.tools.get(...).

Common situations: Passing a single slug string instead of an array, untyped JSON input from user config or an LLM, trailing garbage keys after schema changes between SDK versions.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/621a74610668bc0f. Report an issue: GitHub.