Skip to content

createServerFnTool mentioned in README does not exist in the package #170

@WanChengCheng

Description

@WanChengCheng

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

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions