Skip to content

[BUG] #153

@GitClound

Description

@GitClound

Bug: Invalid schema for cache_warmup function

Description

The mcp__token-optimizer__cache_warmup tool fails with a schema validation error when called through Claude Code MCP client.

Error Message

{
"error": {
"message": "Invalid schema for function 'mcp__token-optimizer__cache_warmup': In context=('properties', 'accessHistory'), array schema missing items.",
"type": "invalid_request_error",
"param": "tools[96].parameters",
"code": "invalid_function_parameters"
}
}

Root Cause

The JSON schema definition for the cache_warmup tool is incomplete. The accessHistory property is declared as an array type but is missing the required items definition:

"accessHistory": {
  "type": "array"
  // Missing "items" definition!
}

According to MCP protocol specification, array schemas must include an items property to define the type of elements in the array.

Environment

- MCP Server: token-optimizer-mcp
- Version: 2.17.0 (latest)
- Node: via npx

Expected Behavior

The tool should accept valid parameters with a properly defined array schema, e.g.:

"accessHistory": {
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "key": { "type": "string" },
      "hitCount": { "type": "number" },
      "timestamp": { "type": "number" }
    }
  }
}

Impact

This bug prevents the cache_warmup tool from being called at all, blocking any functionality that depends on it.

Suggested Fix

Add the missing items property to the accessHistory schema definition in the tool's JSON schema.

---

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