Commit Graph

12 Commits

Author SHA1 Message Date
Alex Knight
4e19bc80c9 Fix null params for parameterless tools (#72673)
* fix tool null params for parameterless schemas

* guard composite required tool schemas
2026-04-27 17:45:59 +10:00
Peter Steinberger
33aea44fe5 refactor: tighten tool schema types 2026-04-23 05:06:58 +01:00
Peter Steinberger
b2472d6560 build: migrate schema deps to typebox 2026-04-23 04:59:42 +01:00
Peter Steinberger
fe0055a1d1 test: dedupe pi tools schema coverage 2026-04-18 19:51:22 +01:00
max
0dbcf81b34 fix: sanitize required fields in tool schemas for Gemini compatibility 2026-04-10 15:01:37 +01:00
Peter Steinberger
fbb2537774 refactor: clarify tool schema normalization 2026-04-03 21:07:19 +09:00
Peter Steinberger
57999f9965 fix: narrow empty MCP tool schema normalization (#60176) (thanks @Bartok9) 2026-04-03 20:45:33 +09:00
Bartok Moltbot
19dbe00763 fix(tools): normalize truly empty MCP tool schemas for OpenAI
Fixes #60158

MCP tools with parameter-free schemas may return truly empty objects
`{}` without a `type` field. The existing normalization handled
`{ type: "object" }` → `{ type: "object", properties: {} }` but
missed the truly empty case.

OpenAI gpt-5.4 rejects tool schemas without `type: "object"` and
`properties`, causing HTTP 400 errors:

```
Invalid schema for function 'flux-mcp__get_flux_instance':
In context=(), object schema missing properties.
```

This change catches empty schemas (no type, no properties, no unions)
before the final pass-through and converts them to the required format.

Added test case for parameter-free MCP tool schemas.
2026-04-03 20:45:33 +09:00
yelog
dd3796aef3 fix: normalize MCP tool schemas missing properties field for OpenAI Responses API
Tools with no parameters produce { type: "object" } schemas without a
properties field. The OpenAI Responses API rejects these, silently
crashing entire sessions.

Add properties: {} injection in normalizeToolParameters() and
convertTools() to ensure all object-type schemas include a properties
field.

Closes #58246
2026-04-01 02:30:45 +09:00
Peter Steinberger
69b54cbb1f test: align pi tool schema fixture type 2026-03-28 05:59:27 +00:00
Peter Steinberger
d42c2f6a17 test(pi-tools): use typebox schema fixture 2026-03-28 05:53:59 +00:00
Peter Steinberger
b236f39104 refactor(agents): generalize tool schema compat cleanup 2026-03-28 05:42:46 +00:00