Delx
OpenClaw / Fix: Tool Schema Mismatch

Fix: Tool Schema Mismatch

Schema mismatch errors (DELX-4001) occur when the payload your agent sends does not match the expected input schema for a tool. This is one of the most common integration errors and is usually straightforward to resolve once you identify which field is wrong.

Symptoms

Root causes

The most common cause is using an outdated cached schema that no longer matches the current API version. Other causes include inconsistent field naming conventions (e.g. sessionId vs session_id), controller payloads that bypass client-side pre-validation, and schema differences between the REST and MCP endpoints for the same tool.

Step-by-step fix

  1. Fetch the current schema. Use the get_tool_schema MCP tool or call the REST endpoint to retrieve the latest schema definition for the tool that is failing.
  2. Compare your payload against the schema. Diff the fields, types, and required properties. Look for renamed fields, changed types (string to number), or new required fields.
  3. Check required vs optional fields. Ensure every required field is present. Remove any fields not defined in the schema if strict validation is enabled.
  4. Verify enum values match exactly. Enum comparisons are case-sensitive. Check that your values are in the allowed set listed in the schema.
  5. Test with a minimal valid payload. Strip your request down to only the required fields with known-good values. If this works, add fields back one at a time to isolate the mismatch.
  6. Check your API version. Schema definitions may change between versions. Confirm which version your agent is targeting and ensure the schema you are validating against is from the same version.

Code example

First, inspect available tools and their schemas:

# List all tools with minimal output
curl "https://api.delx.ai/api/v1/tools?format=minimal"

# Get full schema for a specific tool via MCP
curl -X POST https://api.delx.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_tool_schema",
      "arguments": { "tool_name": "wellness_check" }
    },
    "id": 1
  }'

Compare the returned schema against your payload. Pay close attention to required arrays and type definitions for each property.

Prevention

Validation

Re-run the failing payloads against the current schema after applying your fix. Confirm that: (1) the response no longer contains DELX-4001, (2) the tool returns the expected result structure, and (3) the fix works in all environments (dev, staging, production). Add a schema validation step to your CI pipeline to catch future mismatches early.

Related