JuliusBrussee/caveman · error · Error

tool search failed with HTTP ${response.status}

Error message

tool search failed with HTTP ${response.status}

What it means

Error "tool search failed with HTTP ${response.status}" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/sdk/typescript/src/index.ts:1605

    })),
    query
  };
  if (options?.context !== undefined) body["context"] = options.context;
  if (options?.maxTools !== undefined) body["max_tools"] = options.maxTools;
  if (options?.toolSessionId !== undefined) body["session_id"] = options.toolSessionId;
  // Embedding-similarity is a pure passthrough: the SDK forwards the ranker
  // choice and the gateway honors "embeddings" only when it has an embedding
  // provider wired. The SDK never computes similarity itself (byte-safe, no
  // extra deps).
  if (options?.ranker !== undefined) body["ranker"] = options.ranker;

  const workflow = options?.workflow ?? cave.options.defaultWorkflow ?? "unlabeled-workflow";
  const response = await caveFetch(cave, `${cave.options.baseURL}/sdk/v1/tool-search`, {
    method: "POST",
    headers: headers(cave, workflow),
    body: JSON.stringify(body)
  });
	if (!response.ok) throw new Error(`tool search failed with HTTP ${response.status}`);
  const data = await response.json();

  // Map snake_case response to camelCase
  const rawSent = strictNonNegativeInt(data.sent_schema_tokens);
  const rawFull = strictNonNegativeInt(data.full_schema_tokens);
  const validCounts = rawSent !== null && rawFull !== null && rawSent <= rawFull;
  const sentSchemaTokens = validCounts ? rawSent : 0;
  const fullSchemaTokens = validCounts ? rawFull : 0;
  const savedTokens = fullSchemaTokens - sentSchemaTokens;
  const reductionPct = fullSchemaTokens === 0 ? 0 : Math.round((savedTokens / fullSchemaTokens) * 1000) / 10;

  const catalogByName = new Map<string, CaveTool>();
  for (const tool of catalog) {
    if (typeof tool.name !== "string" || tool.name.trim() === "" || catalogByName.has(tool.name)) {
      throw new Error("tool catalog names must be non-empty and unique");
    }
    catalogByName.set(tool.name, tool);
  }

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Tool search returned a non-2xx status; check credentials and endpoint, then retry.

When it happens

Trigger: Thrown at packages/sdk/typescript/src/index.ts:1605 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/c385930afd714ebd. Report an issue: GitHub.