start-core/server-functions

Create type-safe GET/POST server functions with Zod validation for TanStack Start.

4|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/lespaceman/athena-workflow-marketplace --skill start-core-server-functions-lespaceman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: start-core/server-functions
Source: https://github.com/lespaceman/athena-workflow-marketplace/tree/main/plugins/tanstack-start/skills/upstream/%40tanstack/start-client-core/skills/start-core/server-functions
Command: npx skills add https://github.com/lespaceman/athena-workflow-marketplace --skill start-core-server-functions-lespaceman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type-safe server-side calls and utilities are provided to keep server logic isolated from the client in TanStack Start apps, ensuring safer data access and clearer boundaries.

Core Features & Use Cases

  • GET/POST server functions via createServerFn with .handler
  • input validation using custom validators or Zod
  • useServerFn hook for client-side calls from components
  • server context utilities: getRequest, getRequestHeader, setResponseHeader, setResponseStatus
  • error handling: throw errors, redirects, notFound
  • FormData handling and file organization (.functions.ts, .server.ts)

Quick Start

Create a server function with createServerFn and call it from a loader or component.

Frequently Asked Questions about start-core/server-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create type-safe server functions in TanStack Start?

Type-safe server functions in TanStack Start are created using createServerFn with .handler. This isolates server logic from client code, ensuring safer data access and clearer boundaries.

How does input validation work for server functions with Zod?

Input validation for server functions works by applying custom validators or Zod schemas. This ensures that data passed to GET or POST server functions is strictly typed and validated before execution.

Can I handle redirects and notFound errors in TanStack Start loaders?

Yes, you can handle redirects and notFound errors within TanStack Start loaders. The server functions support robust error handling, allowing you to throw errors, trigger redirects, and return notFound responses.

What's the best way to organize server-only code in a TanStack Start project?

The best way to organize server-only code is by using .functions.ts and .server.ts file conventions. This structure enforces server-only code isolation and handles FormData appropriately.

Do I need a specific hook to call server functions from client components?

Yes, you need the useServerFn hook to call server functions from client components. It bridges the gap between client-side calls and server-side execution within your TanStack Start application.

How do I access server context utilities like request headers in TanStack Start?

You can access server context utilities using functions like getRequest, getRequestHeader, setResponseHeader, and setResponseStatus. These tools manage request and response states directly within server functions.