- Home
- Skills
- APIs & Backend
- api endpoint builder
Works with the AI Agents you already use
api endpoint builder
Generate production-ready REST or GraphQL endpoints with validation, auth, and database integration.
$6
api endpoint builder
Example session with this skill installed
Build a POST /orders endpoint using Express and Zod. It needs to validate the cart array, check user auth, and use my existing Prisma service to save the record.
- Read your context and instructions
- Compiled the api endpoint builder
I have implemented the /orders endpoint following your project's Express and Prisma conventions.
Implementation: POST /orders
import { Router } from 'express';
import { z } from 'zod';
import { authenticate } from '../middleware/auth';
import { prisma } from '../lib/prisma';
import { ApiError } from '../utils/errors';
const router = Router();
const CreateOrderSchema = z.object({
items: z.array(z.object({
productId: z.string().uuid(),
quantity: z.number().int().positive()
})).min(1),
shippingAddress: z.string().min(10)
});
router.post('/orders', authenticate, async (req, res, next) => {
try {
const validatedData = CreateOrderSchema.parse(req.body);
const order = await prisma.$transaction(async (tx) => {
const newOrder = await tx.order.create({
data: {
userId: req.user.id,
address: validatedData.shippingAddress,
items: {
create: validatedData.items
}
}
});
return newOrder;
});
res.status(201).json(order);
} catch (error) {
if (error instanceof z.ZodError) {
return next(new ApiError(400, 'Validation failed', error.errors));
}
next(error);
}
});
export default router;
Next steps
- Register this router in your main
app.tsorroutes/index.tsfile. - Run
npm test tests/orders.test.tsto verify the validation and auth middleware. - Update the
swagger.yamlwith the provided Zod schema definitions.
Connects securely to your tools. The creator never sees your data.
About this skill
Building API endpoints involves more than just routing. You have to handle validation, authentication, business logic delegation, and error mapping while following existing project conventions. This skill automates the creation of production-grade REST or GraphQL endpoints that integrate directly with your repository's service and data layers.
What it does
- Scaffold logic Generates handler or resolver code for REST and GraphQL operations based on your framework.
- Input validation Implements schema-based validation using tools like Zod, Pydantic, or Joi to ensure data integrity.
- Auth integration Injects authorization checks and middleware to protect resources at the object and action boundaries.
- Data mapping Creates repository or service layer calls with support for transactions and multi-write atomicity.
- Contract documentation Produces OpenAPI snippets or GraphQL schema updates to keep your documentation in sync with implementation.
How it works
- Analyze environment The agent inspects existing routes, middleware, and data models to match your project's coding style.
- Map behavior It defines the operation contract, including inputs, access policies, side effects, and idempotency rules.
- Generate implementation The handler, validator, and service logic are written, ensuring types are preserved across layers.
- Verify and test It creates success and failure test cases and runs available lint or type checks to confirm the build.
Frameworks & tools
Works with backend frameworks like Express, FastAPI, and Apollo Server. It utilizes data layers such as Prisma, SQLAlchemy, or raw SQL and integrates with validation libraries like Zod and Pydantic.
Why this beats prompting it yourself
Generic prompts often ignore your existing error-handling patterns or fail to scope records to the authorized user. This skill specifically enforces a pre-flight inspection of your local repository evidence to ensure the new endpoint doesn't break architectural conventions.
Use cases
- Implement a POST route for resource creation with strict role-based access.
- Add a paginated GET collection endpoint with specific filter and sort logic.
- Create a GraphQL mutation that requires multi-step database transactions.
- Refactor an existing endpoint to add validation schemas and standardized error mapping.
Known limitations
Does not support schema design without defined behavior. Requires an existing writable folder for artifacts. Behavior is strictly limited to provided requirements to avoid inferring incorrect business logic.
Requires an existing, writable project folder. Cannot design schemas without defined behavior. Limited to REST and GraphQL patterns. Does not invent business rules not found in requirements.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago