Skip to content

fix(llm): send tools declared without a description - #270

Open
wolfy-j wants to merge 1 commit into
masterfrom
fix/llm-tools-without-description
Open

wolfy-j wants to merge 1 commit into
masterfrom
fix/llm-tools-without-description

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Problem

A tool passed to llm.generate without a description is silently left out of the request on the OpenAI, OpenAI-compatible and Google drivers. The model never sees the tool, and nothing reports why. The Claude and Bedrock drivers send the same tool, so one tool list behaves differently depending on the route.

Cause

map_tools in openai/mapper.lua, openai_compat/mapper.lua and google/mapper.lua filters on tool.name and tool.description and tool.schema. Claude and Bedrock filter on the schema only.

Fix

The three mappers require name and schema and send the tool with the description field omitted when none is given. Every provider API treats the description as optional:

  • OpenAI Responses and Chat Completions function tools: description is optional.
  • Gemini FunctionDeclaration.description: optional.
  • Anthropic tool description: optional (recommended).
  • Bedrock Converse ToolSpecification.description: not required.

Accepting the tool is the behavior Claude and Bedrock already have, so all drivers now share one tool contract. The README states it: a tool needs name and schema; description is optional.

Tests

New "should send a tool declared without a description" cases in openai/mapper_test, openai_compat/mapper_test and google/mapper_test check the tool is sent with its name and parameters and without a description field. They fail before the change. Existing cases for tools missing name or schema are unchanged.

make test in src/llm/test: 2917 passed, 9 skipped. make lint: no issues.

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