Skip to content

[Bug]: WebSearch tool fails with Bedrock schema error: "$.type: string found, array expected" #240

@AlexThreeSixty

Description

@AlexThreeSixty

Prerequisites

  • I have searched existing issues to avoid duplicates
  • I am using the latest version of CodeMie CLI
  • I have read the documentation

Bug Description

Bug Description

The WebSearch tool fails with a 400 error when routed through LiteLLM to AWS Bedrock.

Error

API Error: 400
litellm.BadRequestError: BedrockException -
{"message":"The json schema definition at toolConfig.tools.0.toolSpec.inputSchema
is invalid. Fix the following errors and try again:
$.type: does not have a value in the enumeration [array, boolean, integer, null, number, object, string];
$.type: string found, array expected"}

Root Cause

AWS Bedrock's tool schema validation requires type to be an array (e.g., ["string"]),
but the schema being sent uses a plain string (e.g., "string").
This is a JSON Schema draft version incompatibility.

Steps to Reproduce

Steps to Reproduce

  1. Run codemie-claude
  2. Ask Claude Code to perform a web search (e.g., "search weather in NY")
  3. The WebSearch tool call fails with the above error

Expected Behavior

Expected Behavior

WebSearch should return results successfully.

Actual Behavior

Web Search("weather in New York NY today April 2026")
⎿  Did 0 searches in 1s

CodeMie CLI Version

0.0.53

Which agent are you using?

Claude Code (codemie-claude)

Which provider are you using?

AI/Run SSO

Model

claude-sonnet-4-6

Node.js Version

v25.1.0

Operating System

Windows (native)

Configuration (Redacted)

{
  "version": 2,
  "activeProfile": "codemie-sso",
  "profiles": {
    "default": {
      "provider": "ai-run-sso",
      "codeMieUrl": "https://codemie.lab.epam.com",
      "codeMieProject": "user@epam.com",
      "apiKey": "sso-provided",
      "baseUrl": "https://codemie.lab.epam.com/code-assistant-api",
      "model": "gemini-3.1-pro",
      "haikuModel": "claude-haiku-4-5",
      "sonnetModel": "claude-sonnet-4-5",
      "opusModel": "claude-opus-4-1",
      "name": "default"
    },
    "codemie-sso": {
      "provider": "ai-run-sso",
      "codeMieUrl": "https://codemie.lab.epam.com",
      "codeMieProject": "user@epam.com",
      "apiKey": "sso-provided",
      "baseUrl": "https://codemie.lab.epam.com/code-assistant-api",
      "model": "claude-sonnet-4-6",
      "haikuModel": "claude-haiku-4-5-20251001",
      "sonnetModel": "claude-sonnet-4-6",
      "opusModel": "claude-opus-4-6-20260205",
      "name": "codemie-sso"
    }
  }
}

Error Logs

Additional Context

Workaround

Using WebFetch with a known URL works fine as a fallback.

Environment

  • Platform: Windows 11
  • Model: claude-sonnet-4-6
  • Backend: LiteLLM → AWS Bedrock (claude-haiku-4-5-20251001)

The LLM is able to reach resources on Internet via a direct URL, like https://github.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions