function-creator

Generate typed Convex server functions with validation, authentication, and error handling.

107|12|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/get-convex/convex-agent-plugins --skill function-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: function-creator
Source: https://github.com/get-convex/convex-agent-plugins/tree/main/skills/function-creator
Command: npx skills add https://github.com/get-convex/convex-agent-plugins --skill function-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers generate secure, type-safe Convex functions (queries, mutations, and actions) with built-in validation, authentication, and error handling so API endpoints can be implemented safely and consistently.

Core Features & Use Cases

  • Typed function definitions: validates args and returns with Convex values to prevent runtime errors.
  • Auth & Authorization: enforces user identity checks and resource ownership.
  • Multi-type support: supports query, mutation, and action endpoints with clear guidance and examples.
  • Use Case: Create a new API endpoint for creating a resource, updating it, or performing external calls while preserving safety and determinism.

Quick Start

Use this Skill to generate a secure, typed Convex function for a new API endpoint by defining args, returns, and a handler with proper validation and auth checks.

Frequently Asked Questions about function-creator

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

FAQPage Schema
How do I generate type-safe Convex functions with validation and authentication?

You generate type-safe Convex functions by defining argument validators, return schemas, and handlers with built-in auth checks. This ensures server-side queries, mutations, and actions validate inputs and enforce user identity securely.

What is the best way to enforce authorization in a Convex backend API?

The best way to enforce authorization in a Convex backend is by embedding user identity checks and resource ownership validation directly inside your mutation and query handlers to prevent unauthorized data access.

How do I add argument validation to Convex mutations and queries?

You add argument validation to Convex mutations and queries by defining argument schemas using Convex values. This validates data types at runtime, preventing type errors before the function handler executes.

Can I use Node.js libraries inside Convex actions for external API calls?

Yes, you can use Node.js libraries inside Convex actions. Actions support safe Node.js usage, allowing you to perform external calls and non-deterministic operations while maintaining separation of concerns from queries.

Does this approach support generating separate schemas for arguments and returns?

Yes, generating secure Convex functions supports defining separate schemas for both arguments and returns. This enforces type-safety on incoming requests and outgoing data, ensuring consistent API endpoint behavior.

When should I use a Convex action instead of a mutation or query?

You should use a Convex action instead of a mutation or query when you need to perform external API calls or use Node.js libraries. Actions handle non-deterministic logic, while queries and mutations preserve database determinism.