Skip to content

Tool parsing from OpenAI API dotnet package is different than what LM Studio expects #1652

@LazZiya

Description

@LazZiya

Which version of LM Studio?
Example: LM Studio 0.4.6

Which operating system?
Windows 11

What is the bug?
Tool parsing from OpenAI dotnet package is different than what LM Studio expects. When creating a response from dotnet app with OpenAI package it parse the tools as below:

"tools": [
    {
      "type": "function",
      "name": "say_hello",
      "description": "Says hello to someone",
      "parameters": null,
      "strict": false
    }
  ],

But in LM Studio Docs it seems that tools has different structure:

tools = [
    {
        "type": "function",
        "function": {
            "name": "say_hello",
            "description": "Says hello to someone",
            "parameters": null
        }
    }
]

Logs
Full LM Studio Developer logs:

Developer Logs
2026-03-15 15:46:59 [DEBUG]
 Received request: POST to /v1/responses with body  {
  "model": "gpt-oss-20b",
  "max_output_tokens": 500,
  "tools": [
    {
      "type": "function",
      "name": "say_hello",
      "description": "Says hello to someone",
      "parameters": null,
      "strict": false
    }
  ],
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "hey bro"
        }
      ]
    },
    {
      "type": "message",
      "role": "developer",
      "content": [
        {
          "type": "input_text",
          "text": "You are a helpful assistant."
        }
      ]
    }
  ],
  "store": true,
  "instructions": "",
  "stream": true
}
2026-03-15 15:46:59 [ERROR]
 [Server Error]  {
  "error": {
    "message": "Invalid",
    "type": "invalid_request_error",
    "param": "tools.0.type",
    "code": "invalid_string"
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Create a dotnet project
  2. Install OpenAI dotnet package v2.9.1
  3. Create a streaming Response with function calling as described at OpenAI docs
  4. See error

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