TanStack AI version#
0.1.0
Framework/Library version#
React 19.2
Describe the bug and the steps to reproduce it#
The README at line 82 references a function called createServerFnTool from @tanstack/ai-react:
import { createServerFnTool } from '@tanstack/ai-react'
// Define once, get AI tool AND server function (TanStack Start only)
const getProducts = createServerFnTool({
name: 'getProducts',
inputSchema: z.object({ query: z.string() }),
execute: async ({ query }) => db.products.search(query),
})
// Use in AI chat
chat({ tools: [getProducts.server] })
// Call directly from components (no API endpoint needed!)
const products = await getProducts.serverFn({ query: 'laptop' })
However, this function does not appear to exist in the codebase. I searched through the GitHub repository and could not find any implementation of createServerFnTool.
Questions#
Is createServerFnTool planned but not yet implemented?
If it's not available, what is the recommended approach for sharing code between AI tools and TanStack Start server functions?
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
Cursor
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#
📝 CodeRabbit Plan Mode#
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Related PRs
TanStack/router#5513 - fix: no invalidation for server functions in dev [merged] TanStack/ai#141 - Add TanStack Start server code example for chat API [merged]
👤 Suggested Assignees
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord or schedule a call!