[GH-ISSUE #13967] Cloud endpoint: JSON Schema oneOf not supported for tool calling #71195

Open
opened 2026-05-05 00:39:06 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @mike-nott on GitHub (Jan 29, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/13967

Description

The Ollama cloud endpoint returns a 400 error when tool schemas use the oneOf JSON Schema keyword, which is part of the JSON Schema draft-07 specification.

Error Message

{
  "StatusCode": 400,
  "Status": "400 Bad Request",
  "error": "JSON Schema not supported: could not understand the instance `{'description': \"Device class to filter by (e.g., 'temperature', 'motion', 'door', 'moisture'). Can be a single string or array of strings for OR logic. Check the index for available device classes per domain.\"}`."
}

Reproduction

Using Ollama cloud endpoint with a tool schema containing oneOf:

{
  "name": "discover_entities",
  "description": "Find entities by criteria",
  "parameters": {
    "type": "object",
    "properties": {
      "device_class": {
        "oneOf": [
          {"type": "string"},
          {"type": "array", "items": {"type": "string"}}
        ],
        "description": "Device class to filter by. Can be a single string or array of strings for OR logic."
      }
    }
  }
}

Expected Behavior

The oneOf keyword should be supported as it's part of the JSON Schema specification and is supported by OpenAI's API (which Ollama aims to be compatible with).

Context

  • Local Ollama: Works fine with oneOf schemas
  • Ollama cloud: Fails with 400 error
  • Other providers: OpenAI, Anthropic, Gemini all support oneOf

Impact

This limits the ability to define flexible tool schemas that accept multiple types (string or array), forcing developers to either:

  1. Simplify schemas to the lowest common denominator (losing functionality)
  2. Use local Ollama instead of cloud (works fine locally)
  3. Use a different cloud provider

Request

Could the cloud endpoint's JSON schema parser be updated to support oneOf (and potentially other advanced JSON Schema keywords like anyOf, allOf)?

This would improve OpenAI API compatibility and allow more sophisticated tool definitions.

Thank you!

Originally created by @mike-nott on GitHub (Jan 29, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/13967 ## Description The Ollama cloud endpoint returns a 400 error when tool schemas use the `oneOf` JSON Schema keyword, which is part of the JSON Schema draft-07 specification. ## Error Message ```json { "StatusCode": 400, "Status": "400 Bad Request", "error": "JSON Schema not supported: could not understand the instance `{'description': \"Device class to filter by (e.g., 'temperature', 'motion', 'door', 'moisture'). Can be a single string or array of strings for OR logic. Check the index for available device classes per domain.\"}`." } ``` ## Reproduction Using Ollama cloud endpoint with a tool schema containing `oneOf`: ```json { "name": "discover_entities", "description": "Find entities by criteria", "parameters": { "type": "object", "properties": { "device_class": { "oneOf": [ {"type": "string"}, {"type": "array", "items": {"type": "string"}} ], "description": "Device class to filter by. Can be a single string or array of strings for OR logic." } } } } ``` ## Expected Behavior The `oneOf` keyword should be supported as it's part of the JSON Schema specification and is supported by OpenAI's API (which Ollama aims to be compatible with). ## Context - **Local Ollama**: Works fine with `oneOf` schemas - **Ollama cloud**: Fails with 400 error - **Other providers**: OpenAI, Anthropic, Gemini all support `oneOf` ## Impact This limits the ability to define flexible tool schemas that accept multiple types (string or array), forcing developers to either: 1. Simplify schemas to the lowest common denominator (losing functionality) 2. Use local Ollama instead of cloud (works fine locally) 3. Use a different cloud provider ## Request Could the cloud endpoint's JSON schema parser be updated to support `oneOf` (and potentially other advanced JSON Schema keywords like `anyOf`, `allOf`)? This would improve OpenAI API compatibility and allow more sophisticated tool definitions. Thank you!
GiteaMirror added the cloud label 2026-05-05 00:39:06 -05:00
Author
Owner

@ryanmon1 commented on GitHub (Jan 29, 2026):

Cloud models don't support this anymore unfortunately

<!-- gh-comment-id:3820838628 --> @ryanmon1 commented on GitHub (Jan 29, 2026): Cloud models don't support this anymore unfortunately
Author
Owner

@drifkin commented on GitHub (Feb 6, 2026):

hi @mike-nott, sorry about that, we definitely should support all of those. Could you tell me which cloud models you tried?

<!-- gh-comment-id:3862115810 --> @drifkin commented on GitHub (Feb 6, 2026): hi @mike-nott, sorry about that, we definitely should support all of those. Could you tell me which cloud models you tried?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71195