| Primitive | Supports Response | Notes |
|---|---|---|
| API | Yes | Returns the JSON object defined in the response block |
| AI Agent | No | Your agent will return messages to the user, but you don’t directly define the response like other primitives |
| Trigger | Yes | Returns the JSON object defined in the response block |
| Background Task | No | No responses are supported |
| Custom Function | Yes | Returns the JSON object defined in the response block |
| Middleware | Yes | Returns the JSON object defined in the response block |
| AI Tool | Yes | Returns the JSON object defined in the response block |
| MCP Server | No | Your tools will deliver messages back to the MCP client, but you don’t directly define a response like other primitives |
Adding a Response
Responses will usually come from a variable of some kind, but you can also manually define a static value, or use filters to create a combination of both. When building visually, Xano will automatically add a response of the first variable in the stack. For example, if you start by adding a Query All Records function, Xano will make sure that the response is the output of that function. Responses can be returned asself, meaning that it is not nested in another object.
Example of a self response
Example of a nested response
- Visually: Canvas View
- Visually: Function Stack
- XanoScript
Find your response block and choose Add a Response.
Give your response a name, and choose whether you want to return it as 

self or nested under another value.