start-core/server-functions

Create type-safe server functions for TanStack Start with createServerFn.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/redacharf/fin-punk --skill start-core-server-functions-redacharf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: start-core/server-functions
Source: https://github.com/redacharf/fin-punk/tree/main/.agents/skills/start-core/server-functions
Command: npx skills add https://github.com/redacharf/fin-punk --skill start-core-server-functions-redacharf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to building type-safe server-side RPCs using TanStack Start, enabling clean separation of server logic from client code and ensuring secure, predictable server interactions via createServerFn, inputValidator, and server context utilities.

Core Features & Use Cases

  • Create server functions with createServerFn and method validation
  • Validate inputs using inputValidator (function or Zod)
  • Call server functions from loaders, components, and event handlers via useServerFn
  • Access server context details with getRequest, getRequestHeader, setResponseHeader, setResponseStatus
  • Handle errors with thrown errors, redirects, and notFound responses
  • Support streaming, FormData handling, and file organization (.functions.ts, .server.ts)

Quick Start

Create a server function using createServerFn({ method: 'GET' }).handler(...) and invoke 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 the createServerFn API. You define a server function by specifying a method like GET or POST and attaching a handler, which can then be securely called from loaders or components.

How do I validate inputs for TanStack Start server functions?

Input validation for TanStack Start server functions is handled using the inputValidator API. It accepts either a custom validation function or a Zod schema to ensure the data passed to your server RPCs is securely typed and predictable.

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

You access request headers and server context in TanStack Start using server context utilities. Functions like getRequest, getRequestHeader, setResponseHeader, and setResponseStatus allow you to read and modify server context details within your RPCs.

How should I organize TanStack Start server function files in my project?

Organize TanStack Start server function files using .functions.ts and .server.ts extensions. This file naming convention ensures clean separation of server logic from client code, keeping your server-side RPCs secure and maintainable.

How do I handle errors and redirects in TanStack Start server functions?

Handle errors and redirects in TanStack Start server functions by throwing errors directly within the handler. You can also return redirect responses or notFound responses to control navigation and manage invalid states effectively.

Can I use TanStack Start server functions for streaming and FormData handling?

Yes, TanStack Start server functions support both streaming and FormData handling. This allows you to manage progressive data delivery and file uploads securely within your type-safe server-side RPC architecture.