#1775·smolagents

ENH: Check Tool input keys

Author: cemdeCreated Sep 16, 2025Updated Sep 29, 2026
Labelsenhancement

Problem Not adhering to the proposed dictionary structure to declare tool inputs yields no errors in smolagents but causes the openai package (talking to gemini) to fail with an error message that seems unrelated. Example below.

Proposed solution It would be great if there was a mechanism that checks for each tool that for each input there is exactly two keys: "type" and "description" and nothing else.

Is this not possible with the current options. It is 100% possible with the current package, but relating the error from the openai package to this issue, but it took me a few more hours than it would have if the misconfiguration was discovered earlier.

Alternatives considered N/A

Additional context (optional)

Example:

  1. Configure the OpenAIServerModel to Gemini.
  2. Initialize a Tool with input={..., "resturant_name": {"type": "string", "description": "...", "required": True}. The moment the server gets called, I get this error message:
openai.BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'value at properties.restaurant_name must be a list', 'status': 'INVALID_ARGUMENT'}}]

"properties.restaurant_name must be a list" is not useful whatsoever to figure out what the root issue is.


Checklist

  • I have searched the existing issues and have not found a similar feature request.
  • I have verified that this feature is not already implemented in the latest version.
  • I am willing to work on this feature and submit a pull request. (optional)