Functions
A project is a set of functions. Each one can answer HTTP requests, run on a schedule and be a tool for AI agents — or any mix of the three.
Every piece of code in a project is a function: one source file with a handler. What it's for is a matter of settings, not of a different kind of thing:
| Option | What it does |
|---|---|
| API | A public URL — https://<project>.fn.wispfn.com/<name> with one method — that apps, scripts and webhooks call over HTTPS. It's also in the project's OpenAPI document. |
| MCP | Offers it as a tool to AI agents through the project's MCP server, described by its input and output schemas. |
| Schedule | Runs it on its own — every 15 minutes, every Monday at 9am. See Schedules. |
| Library | Lets your other functions call it from code, like a shared helper: only this project's (private) or any project's in the workspace (internal). See Visibility and calls. |
Tick any mix in the function's Settings; each option you tick shows its own settings below. A function without an API is background work or a helper: syncs, reports, cleanups, reminders — only what you ticked (and the console) can run it.
Two names are special: before and after run around every HTTP function and are never exposed themselves.
#Write a handler
export async function handler(req) {
const name = req.query.name ?? 'world';
return { status: 200, body: { message: `Hello, ${name}!` } };
}def handler(req):
name = req["query"].get("name", "world")
return {"status": 200, "body": {"message": f"Hello, {name}!"}}async def handler works in Python too. See Request and response for every field. Functions without HTTP get their input as the JSON body (req.body); their method is always POST.
#In the console
The Functions list shows every function with icons for what it does:
| Icon | Meaning |
|---|---|
GET POST … | Exposed over HTTP with this method |
| ƒ | Not exposed over HTTP |
| 🔒 | Private: not callable by anyone on the internet (private, internal, or HTTP off) |
| 🕒 | Has a schedule (highlighted when it's on) |
| 🔌 | An MCP tool (highlighted when the project's MCP server is on) |
before and after appear in the list too, with a shield icon.
#Names and subpaths
A function's name is one URL segment: lowercase letters, digits, - and _. For HTTP functions, anything after it arrives as req.subpath:
GET /orders/1042/items → function "orders", req.subpath = "/1042/items"#Methods
An HTTP function answers one method — GET, POST, PUT, PATCH or DELETE. To read and create orders, use two functions (for example GET /orders and POST /create-order). CORS and OPTIONS preflight requests are handled for you.
#Schemas
Each function can declare an input schema and an output schema (JSON Schema). The input schema describes query parameters (for GET and DELETE) or JSON body fields (everything else). The assistant writes them for you and keeps them in sync. They document your API and describe the function as an MCP tool.
#Settings
| Setting | What it does |
|---|---|
| Name and description | Renaming changes the URL. |
| API | Method, example request and edge caching for GET. |
| MCP | The input and output schemas of the tool (they also type the function in the editor). |
| Schedule | When it runs. See Schedules. |
| Library | Private (this project) or internal (the workspace). Always on when the API is. |
| Limit | Per-function call limit, in the project settings. See Rate limits. |
#OpenAPI
Every project publishes an OpenAPI 3.1 document of its functions with an API, built from their schemas:
https://<project>.fn.wispfn.com/openapi.json the published version
https://<project>.fn.wispfn.com/openapi.json?test the draftUse it to generate clients, import the API into Postman or Insomnia, or put a gateway in front of it. When the project requires API keys, the document declares them. Find the link under Connect → API.
#Limits
| Limit | Value |
|---|---|
| Run time per request | 15 seconds |
| Memory | 256 MB |
| Request and response size | 6 MB |
| Disk | Temporary /tmp only — use storage for anything that must persist |
#Edit code yourself
Open a function and edit it in the editor. Saving creates a new draft version, just like a change from the assistant. You can also edit locally and push with the CLI.