But the client function shows input as unknown.
import { toolDefinition } from '@tanstack/ai'
import z from 'zod'
export const saveToLocalStorageDef = toolDefinition({
name: 'save_to_local_storage',
description: 'Save data to browser local storage',
inputSchema: z.object({
key: z.string().describe('Storage key'),
value: z.string().describe('Value to store'),
}),
outputSchema: z.object({
saved: z.boolean(),
}),
})
const saveToLocalStorage = saveToLocalStorageDef.client((input) => {
localStorage.setItem(input.key, input.value)
return { saved: true }
})
TanStack AI version
v0.2.2
Framework/Library version
v19.2.3
Describe the bug and the steps to reproduce it
Tanstack ai docs mention that tool definition is fully typesafe.
But the client function shows input as unknown.
Minimal repro:
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
None
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct