A Microfn function is a small JavaScript or TypeScript module with an exported main function. Saving it deploys an HTTP endpoint you can call from the dashboard, an agent, or another application.
Create the function
Open Microfn, create a function named greet, and replace the editor contents with:
type Input = { name?: string };
export async function main(input: Input) {
const name = input.name?.trim() || "there";
return { message: `Hello, ${name}!` };
}
Save the function and wait for the deployment to finish.
Run it
Open the runner, enter this JSON, and run the function:
{"name":"Ada"}
The result should be:
{"message":"Hello, Ada!"}
Every run appears under Executions, with its input, output, logs, and status. If you change the code, save again before testing the new version.
Ask an agent to build it
After you connect Microfn through MCP, an agent can create and test the same function for you.
Review generated code before giving it credentials or connecting it to an external system. Next, call an external API or turn the function into an MCP tool.