Skip to content

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

Closed

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.

Activity

  1. coderabbitai commented on Dec 22, 2025

    @coderabbitai
    Contributor

    📝 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]
    #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:

    issue_enrichment:
      auto_enrich:
        enabled: false

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

  2. changed the title [-]createServerFnTool does not exist in any package[/-] [+]createServerFnTool mentioned in README does not exist in the package[/+] on Dec 22, 2025
  3. AlemTuzlak commented on Dec 26, 2025

    @AlemTuzlak
    Contributor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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