Skip to content

Alert rule tools emit bare boolean JSON Schema values, breaking Fireworks AI and other providers #594

@shawnpetersen

Description

@shawnpetersen

Description

The create_alert_rule and update_alert_rule tools emit bare boolean JSON Schema values (e.g., "model": true) in their tool definitions. While valid per the JSON Schema specification (true means "accept any value"), LLM providers like Fireworks AI reject these with a 500 internal_server_error.

Reproduction

  1. Connect mcp-grafana to any LLM gateway that routes to Fireworks AI
  2. Include create_alert_rule or update_alert_rule in the tool list
  3. Send a chat completion request with 26+ tools (including the alert rule tools)
  4. Fireworks returns: {"error":{"object":"error","type":"internal_server_error","code":"invalid_request_error","message":"server had an error while processing your request, please retry again after a brief wait"}}

With 25 tools (excluding alert rule tools): succeeds.
With just create_alert_rule alone: fails.

Root Cause

The alert rule params include Go interface{} fields (likely QueryData or the alert rule model). When reflected to JSON Schema via the jsonschema library, interface{} produces a bare true. Fireworks AI's schema parser does not handle bare boolean schemas.

Affected Tools

  • create_alert_rule — has "model": true in schema
  • update_alert_rule — same

Expected Behavior

Bare boolean schemas should be replaced with equivalent object schemas:

  • true{"type": "object"} (or more specific if the type is known)
  • false{"not": {}}

Workaround

We applied a sanitizeSchema() function in our MCP adapter layer that recursively converts bare booleans before passing schemas to the LLM provider. See: androidStern-personal/openclaw-mcp-adapter#9

Environment

  • mcp-grafana: Docker image grafana/mcp-grafana (latest as of 2026-02-23)
  • Grafana: 11.x with Editor-role service account
  • LLM Provider: Fireworks AI (Kimi K2.5 model)
  • Gateway: LiteLLM v1.81.13 + OpenClaw v2026.2.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions