Skip to content
Source
Sign inSign up
TanStack/ai

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

ClosedWanChengCheng(GitHub profile, opens in a new tab) opened this issue 2 comments

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?

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.
  1. 📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    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


  2. 🧪 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:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  • Thank you, this was left as an artifact by accident from our experimentation with start specific abstractions (not saying this won't come in the future though) but this doesn't exist yet

  • AlemTuzlak closed this

  • Sign in to join this conversation.