Describe the issue
The OpenAI-compatible /v1/chat/completions endpoint rejects a request containing a custom/freeform tool definition. The server assumes every tool contains a function property and returns HTTP 400 for a tool whose type is custom.
Observed response:
Invalid request: [json.exception.out_of_range.403] key 'function' not found
A control request containing only a standard function tool passes tool parsing. The expected behavior is either to accept the custom tool schema or return a clear unsupported-tool-type error rather than attempting to read a missing function property.
To reproduce
- Use
Microsoft.AI.Foundry.Local version 2.0.1.
- Load
qwen3.5-2b-text-cuda-gpu:1 and start the local web service.
- POST to
/v1/chat/completions with one standard function tool and this additional tool:
{
"type": "custom",
"custom": {
"name": "freeform_tool",
"description": "Accepts freeform input.",
"format": {
"type": "grammar",
"grammar": {
"syntax": "lark",
"definition": "start: /(?s).+/"
}
}
}
}
The response is HTTP 400 with key 'function' not found. Sending the same request without the custom tool progresses past request parsing.
Urgency
This prevents clients using OpenAI-compatible custom/freeform tool schemas from sending those requests to Foundry Local.
System information
- Platform and architecture: Windows X64
- OS version: Windows 11
- Installation type: Released package/binary
- Foundry Local version: Microsoft.AI.Foundry.Local 2.0.1
- API or surface area: REST API
- Hardware acceleration/backend: WebGPU/CUDA
- Backend/runtime version: ONNX Runtime 1.28.0; ONNX Runtime GenAI 0.15.2
Describe the issue
The OpenAI-compatible
/v1/chat/completionsendpoint rejects a request containing a custom/freeform tool definition. The server assumes every tool contains afunctionproperty and returns HTTP 400 for a tool whose type iscustom.Observed response:
A control request containing only a standard function tool passes tool parsing. The expected behavior is either to accept the custom tool schema or return a clear unsupported-tool-type error rather than attempting to read a missing
functionproperty.To reproduce
Microsoft.AI.Foundry.Localversion2.0.1.qwen3.5-2b-text-cuda-gpu:1and start the local web service./v1/chat/completionswith one standard function tool and this additional tool:{ "type": "custom", "custom": { "name": "freeform_tool", "description": "Accepts freeform input.", "format": { "type": "grammar", "grammar": { "syntax": "lark", "definition": "start: /(?s).+/" } } } }The response is HTTP 400 with
key 'function' not found. Sending the same request without the custom tool progresses past request parsing.Urgency
This prevents clients using OpenAI-compatible custom/freeform tool schemas from sending those requests to Foundry Local.
System information