Skip to content

fix(schema): wrap parameters in OpenAI function-calling format#1

Open
vp-nyxe wants to merge 1 commit into
fastfinge:mainfrom
vp-nyxe:fix/schema-openai-format
Open

fix(schema): wrap parameters in OpenAI function-calling format#1
vp-nyxe wants to merge 1 commit into
fastfinge:mainfrom
vp-nyxe:fix/schema-openai-format

Conversation

@vp-nyxe

@vp-nyxe vp-nyxe commented May 21, 2026

Copy link
Copy Markdown

Problem

The kagi_enriched_search tool schema was defined as a bare JSON Schema object (type/ properties/ required at the top level). The Hermes Agent schema sanitizer expects the OpenAI function-calling format with a parameters wrapper, so it substituted empty parameters and discarded the actual property definitions.

Result: the model sees properties: {} and calls the tool with no arguments, causing "query is required" on every invocation.

Fix

  • Added name field to the schema
  • Wrapped type, properties, required under a parameters key
  • Matches the pattern used by WEB_SEARCH_SCHEMA and other built-in tools

Before

{
  "type": "object",
  "description": "...",
  "properties": { ... },
  "required": ["query"]
}

After

{
  "name": "kagi_enriched_search",
  "description": "...",
  "parameters": {
    "type": "object",
    "properties": { ... },
    "required": ["query"]
  }
}

The schema sanitizer expects 'parameters' key wrapping the JSON Schema
object, matching the OpenAI function calling spec used by built-in tools.
Previously the schema used bare JSON Schema format (type/properties/required
at the top level), causing the sanitizer to substitute empty parameters
and discard the actual property definitions.

Fix:
- Added 'name' field to the schema
- Wrapped 'type', 'properties', 'required' under 'parameters' key
- Matches the pattern used by WEB_SEARCH_SCHEMA and other built-in tools

This fixes kagi_enriched_search returning 'query is required' on every call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant