Skip to content

Comments

fix: use actual tool description instead of type#146

Merged
louisgv merged 1 commit intoOpenRouterTeam:mainfrom
bebiksior:fix/fix-tool-descriptions
Aug 9, 2025
Merged

fix: use actual tool description instead of type#146
louisgv merged 1 commit intoOpenRouterTeam:mainfrom
bebiksior:fix/fix-tool-descriptions

Conversation

@bebiksior
Copy link
Contributor

When defining tools in the AI SDK

export const sendRequestTool = tool({
  description: "Send the current HTTP request for this replay session",
  inputSchema: z.object({}),
  execute: async () => {},
});

According to the OpenRouter docs, the description should be sent in the tools[].function.description field so the model knows when and how to use the tool

Currently, the OpenRouter provider sends tool.type instead of the actual description, resulting in requests like this

CleanShot 2025-08-08 at 22 24 20

This PR updates the provider to send the correct description value, matching the behavior described in the OpenRouter docs and used by other ai sdk providers

CleanShot 2025-08-08 at 22 16 32

Copy link
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 🙏

@louisgv louisgv merged commit 6121900 into OpenRouterTeam:main Aug 9, 2025
3 checks passed
@mutewinter
Copy link

Just wanted to say that this was a catastrophic bug for us, and you should shout from the hilltops that people need to upgrade from the beta to fix this behavior.

kesavan-byte pushed a commit to osm-API/ai-sdk-provider that referenced this pull request Feb 13, 2026
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.

3 participants