Develop serverless edge functions with PubNub Functions 2.0
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.79x
Baseline
Agent success rate without this tile
52%
{
"context": "Evaluates whether the agent correctly writes a PubNub On Request function as an HTTP endpoint with proper response handling, CORS support, and method-based routing. Tests knowledge of the On Request function signature and HTTP patterns specific to PubNub Functions.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Request and response params",
"description": "The function signature includes both request and response parameters: export default async (request, response) =>",
"max_score": 20
},
{
"name": "response.send with status",
"description": "All responses use response.send(body, statusCode) with appropriate HTTP status codes (200, 400, 404, 500, etc.)",
"max_score": 20
},
{
"name": "CORS headers set",
"description": "Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers are set on response.headers",
"max_score": 20
},
{
"name": "OPTIONS preflight handled",
"description": "OPTIONS requests are handled early by returning response.send('', 200) before business logic",
"max_score": 20
},
{
"name": "Method-based routing",
"description": "Logic branches on request.method to handle different HTTP methods (GET, POST, PUT, DELETE) with distinct behavior",
"max_score": 20
}
]
}