In Xano, prompts and resources are workspace objects, just like tools. You build each one
once, with its own function stack, then attach it to one or more MCP servers. They’re under
Agents & MCP → Prompts
and Resources in the sidebar.
Because they’re workspace objects, prompts and resources work everywhere tools do: version
history, publishing, branching and merges, Git sync,
xano workspace push and pull, the Metadata API, and
request history.
Prompts
A prompt’s inputs are its arguments, and its response is the list of messages the client receives.Create a prompt
- Builder
- XanoScript
1
Add the prompt
From the sidebar, go to Agents & MCP → Prompts and click Add Prompt.- Name: what MCP clients use to request the prompt, such as
code_review. Letters, numbers, dashes and underscores only. - Description: an internal-only field for documenting the prompt’s purpose.
- Tags: for organizing your prompts.
2
Add arguments
Under Arguments, add an input for each argument a client passes. A required input with no default is a required argument, and the client is refused before your stack runs if it’s missing. Each input’s description is sent to the client too.3
Build the messages
Add functions under Function Stack to build the prompt’s messages, then return them under Response, for example:4
Publish and attach
Publish the prompt, then attach it to an MCP server.What a prompt can return
role is user or assistant. content is a string, or a single MCP content block:
text, image, audio, resource_link or resource. Anything else is an error that names
the bad value.
Resources
A resource has a URI that clients use to read it. Its response is the content they get back. A resource is either:- Static, with a literal URI such as
docs://readme. It has no inputs. - A template, with variables in the URI, such as
orders://{region}/{order_id}. Each variable becomes an input, and your stack sees the values from the URI the client read.
Create a resource
- Builder
- XanoScript
1
Add the resource
From the sidebar, go to Agents & MCP → Resources and click Add Resource.- Name: the resource’s name, such as
readme. - URI: a literal URI (
docs://readme) for a static resource, or a template with{variables}(orders://{order_id}). Each template variable is added as atextinput. Change its type afterward if you need to. - Description and Tags: internal fields for organizing your resources.
2
Build the contents
Template variables are listed under URI Variables. Add functions under Function Stack to build the resource’s contents, and return them under Response.3
Publish and attach
Publish the resource, then attach it to an MCP server.URI rules
- A URI must start with a scheme, such as
docs://ororders://, and can’t contain whitespace. - Template variables are simple
{name}placeholders. Operators and modifiers like{+path},{#x},{x*},{x:3}and lists like{a,b}aren’t supported. - Each variable can appear once, two variables can’t sit side by side, and each matches exactly one path segment.
- Every variable needs a matching input of type
text,int,decimal,bool,enum,emailoruuid, as a single value rather than a list. Every input must be a variable. - Values are converted to the input’s type before your stack runs. A client reading
orders://eu/abcwhereorder_idis anintgets an error. - When a literal URI and a template both match, the literal one wins.
What a resource can return
The MIME type comes from the item’s own
mime_type, then the resource’s MIME Type, then
the file’s type, and finally text/plain, application/json or application/octet-stream.
Annotations
Resource annotations are hints clients may use to decide how to present a resource. Leave any of them unset to make no claim.Before prompts and resources were workspace objects, you could expose a tool as a resource by
setting its Tool Type to Resource in Connection Settings. Those legacy resource
tools keep working, and you can still view or convert them to a regular tool. New resources
should be resource objects. If both share a URI, the resource object wins.
Attach to an MCP server
A client only sees, reads and completes the prompts and resources attached to the server it connected to.- Builder
- XanoScript
Open the MCP server and click Connect →
Connect Prompt or Connect Resource.
Pick one from the list, or click Create a new Prompt to build one and attach it in one
step.The server page has Tools, Prompts and Resources tabs. On the Prompts or
Resources tab, click the pencil icon on a row to open Manage MCP Server Connection:
- Allow Connections: turn the prompt or resource on or off for this server.
- Authentication: Public, or an auth-enabled table whose users must be signed in.
Argument autocomplete
When a client asks for completions while a user fills in a prompt argument or a resource template variable, Xano suggests values forenum inputs. Matching is a case-insensitive
prefix match on the enum’s values, up to 100 suggestions, and no stack runs. Other input
types return no suggestions.
To give an argument autocomplete, make it an enum. In the code_review example above, a
client that supports completions suggests php and typescript for language.
Ask the user and report progress
Prompt and resource stacks can use the same MCP functions as tools: Ask the User (Elicit) to request input from the client’s user mid-request, and Report Progress to send progress updates. See MCP Functions.Test and debug
Use Run & Debug on a prompt or resource to run it with test inputs and see the messages or contents it returns. If the stack uses Ask the User (Elicit), choose a simulated answer for each elicit under Simulated elicitation. The stack runs for real, so any writes it makes happen. Prompt and resource runs are logged on their own Prompts and Resources tabs in Request History.Metadata API
Create and update take a raw XanoScript body with
Content-Type: text/x-xanoscript. They
need the same permissions as tools.