@xano/developer-mcp 2.3.0-beta.1 → 2.3.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -14
- package/dist/cli_docs/index.js +0 -4
- package/dist/cli_docs/topics/function.js +0 -2
- package/dist/cli_docs/topics/knowledge.js +1 -2
- package/dist/cli_docs/topics/workspace.js +23 -12
- package/dist/meta_api_docs/format.js +15 -2
- package/dist/meta_api_docs/index.js +0 -2
- package/dist/meta_api_docs/topics/agent.js +36 -24
- package/dist/meta_api_docs/topics/api.js +50 -43
- package/dist/meta_api_docs/topics/apigroup.js +2 -2
- package/dist/meta_api_docs/topics/authentication.js +1 -1
- package/dist/meta_api_docs/topics/function.js +26 -25
- package/dist/meta_api_docs/topics/history.js +42 -11
- package/dist/meta_api_docs/topics/mcp_server.js +23 -28
- package/dist/meta_api_docs/topics/middleware.js +36 -32
- package/dist/meta_api_docs/topics/table.js +43 -22
- package/dist/meta_api_docs/topics/task.js +40 -40
- package/dist/meta_api_docs/topics/tool.js +39 -26
- package/dist/meta_api_docs/topics/workflows.js +84 -28
- package/dist/meta_api_docs/topics/workspace.js +1 -1
- package/dist/tools/validate_xanoscript.js +6 -9
- package/dist/xanoscript.js +0 -1
- package/dist/xanoscript_docs/README.md +25 -8
- package/dist/xanoscript_docs/agents.md +14 -5
- package/dist/xanoscript_docs/ai.md +820 -0
- package/dist/xanoscript_docs/branch.md +109 -29
- package/dist/xanoscript_docs/database.md +7 -5
- package/dist/xanoscript_docs/docs_index.json +36 -22
- package/dist/xanoscript_docs/essentials.md +53 -19
- package/dist/xanoscript_docs/file-uploads.md +4 -4
- package/dist/xanoscript_docs/mcp-servers.md +2 -2
- package/dist/xanoscript_docs/prompts.md +4 -2
- package/dist/xanoscript_docs/realtime-v2.md +4 -2
- package/dist/xanoscript_docs/resources.md +3 -1
- package/dist/xanoscript_docs/survival.md +1 -5
- package/dist/xanoscript_docs/tables.md +58 -0
- package/dist/xanoscript_docs/tools.md +1 -1
- package/dist/xanoscript_docs/triggers.md +133 -3
- package/dist/xanoscript_docs/types.md +14 -1
- package/dist/xanoscript_docs/unit-testing.md +29 -2
- package/dist/xanoscript_docs/version.json +2 -2
- package/dist/xanoscript_docs/workflow-tests.md +18 -0
- package/dist/xanoscript_docs/working.md +39 -15
- package/package.json +2 -3
- package/dist/cli_docs/topics/policy.d.ts +0 -2
- package/dist/cli_docs/topics/policy.js +0 -91
- package/dist/cli_docs/topics/skills.d.ts +0 -2
- package/dist/cli_docs/topics/skills.js +0 -57
- package/dist/meta_api_docs/topics/policy.d.ts +0 -3
- package/dist/meta_api_docs/topics/policy.js +0 -135
- package/dist/xanoscript_docs/policies.md +0 -308
|
@@ -59,35 +59,30 @@ export const toolDoc = {
|
|
|
59
59
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
60
60
|
],
|
|
61
61
|
request_body: {
|
|
62
|
-
type: "
|
|
63
|
-
|
|
64
|
-
name: { type: "string", description: "Tool name", required: true },
|
|
65
|
-
description: { type: "string", description: "Tool description (shown to AI)" },
|
|
66
|
-
xanoscript: { type: "string", description: "XanoScript tool definition", required: true }
|
|
67
|
-
}
|
|
62
|
+
type: "text/x-xanoscript",
|
|
63
|
+
description: "The tool as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, instructions, inputs and response come from the script. A JSON body's `xanoscript` field is not read: the route drops fields it does not declare, so a JSON request creates the tool without its code."
|
|
68
64
|
},
|
|
69
65
|
example: {
|
|
70
66
|
method: "POST",
|
|
71
67
|
path: "/workspace/1/tool",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
xanoscript: `tool lookup_order {
|
|
68
|
+
headers: { "Content-Type": "text/x-xanoscript" },
|
|
69
|
+
body: `tool "get_order_status" {
|
|
70
|
+
instructions = "Check the current status of an order by its ID."
|
|
76
71
|
input {
|
|
77
|
-
int order_id
|
|
78
|
-
text email?
|
|
72
|
+
int order_id { description = "Order ID to check" }
|
|
79
73
|
}
|
|
80
74
|
stack {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
db.get "order" {
|
|
76
|
+
field_name = "id"
|
|
77
|
+
field_value = $input.order_id
|
|
78
|
+
} as $order
|
|
79
|
+
}
|
|
80
|
+
response = {
|
|
81
|
+
order_id: $order.id,
|
|
82
|
+
status: $order.status,
|
|
83
|
+
updated_at: $order.updated_at
|
|
87
84
|
}
|
|
88
|
-
response = $order
|
|
89
85
|
}`
|
|
90
|
-
}
|
|
91
86
|
}
|
|
92
87
|
},
|
|
93
88
|
{
|
|
@@ -101,12 +96,30 @@ export const toolDoc = {
|
|
|
101
96
|
{ name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
|
|
102
97
|
],
|
|
103
98
|
request_body: {
|
|
104
|
-
type: "
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
99
|
+
type: "text/x-xanoscript",
|
|
100
|
+
description: "The whole tool as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`; it replaces the current definition. A JSON body's `xanoscript` field is not read: the route drops fields it does not declare, so a JSON request never changes the tool's code."
|
|
101
|
+
},
|
|
102
|
+
example: {
|
|
103
|
+
method: "PUT",
|
|
104
|
+
path: "/workspace/1/tool/5",
|
|
105
|
+
headers: { "Content-Type": "text/x-xanoscript" },
|
|
106
|
+
body: `tool "get_order_status" {
|
|
107
|
+
instructions = "Check the current status of an order by its ID."
|
|
108
|
+
input {
|
|
109
|
+
int order_id { description = "Order ID to check" }
|
|
110
|
+
}
|
|
111
|
+
stack {
|
|
112
|
+
db.get "order" {
|
|
113
|
+
field_name = "id"
|
|
114
|
+
field_value = $input.order_id
|
|
115
|
+
} as $order
|
|
116
|
+
}
|
|
117
|
+
response = {
|
|
118
|
+
order_id: $order.id,
|
|
119
|
+
status: $order.status,
|
|
120
|
+
updated_at: $order.updated_at
|
|
121
|
+
}
|
|
122
|
+
}`
|
|
110
123
|
}
|
|
111
124
|
},
|
|
112
125
|
{
|
|
@@ -29,22 +29,45 @@ export const workflowsDoc = {
|
|
|
29
29
|
"9. `POST /workspace/{id}/apigroup/{id}/api` - Create PUT endpoint",
|
|
30
30
|
"10. `POST /workspace/{id}/apigroup/{id}/api` - Create DELETE endpoint"
|
|
31
31
|
],
|
|
32
|
-
example: `// Example:
|
|
32
|
+
example: `// Example: create a users table and a list endpoint.
|
|
33
|
+
// Each object is sent as XanoScript: the raw body, Content-Type: text/x-xanoscript.
|
|
33
34
|
|
|
34
|
-
// 1. Create table
|
|
35
|
+
// 1. Create the table
|
|
35
36
|
POST /workspace/1/table
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
Content-Type: text/x-xanoscript
|
|
38
|
+
|
|
39
|
+
table "user" {
|
|
40
|
+
auth = true
|
|
41
|
+
schema {
|
|
42
|
+
int id
|
|
43
|
+
timestamp created_at?=now
|
|
44
|
+
text name filters=trim
|
|
45
|
+
email email filters=trim|lower {
|
|
46
|
+
sensitive = true
|
|
47
|
+
}
|
|
48
|
+
password password
|
|
49
|
+
}
|
|
50
|
+
index = [
|
|
51
|
+
{type: "primary", field: [{name: "id"}]}
|
|
52
|
+
{type: "btree|unique", field: [{name: "email"}]}
|
|
53
|
+
]
|
|
39
54
|
}
|
|
40
55
|
|
|
41
|
-
// 2. Create list endpoint
|
|
56
|
+
// 2. Create the list endpoint
|
|
42
57
|
POST /workspace/1/apigroup/1/api
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
58
|
+
Content-Type: text/x-xanoscript
|
|
59
|
+
|
|
60
|
+
query "orders" verb=GET {
|
|
61
|
+
description = "List orders, 20 a page"
|
|
62
|
+
input {
|
|
63
|
+
int page?=1
|
|
64
|
+
}
|
|
65
|
+
stack {
|
|
66
|
+
db.query "order" {
|
|
67
|
+
return = {type: "list", paging: {page: $input.page, per_page: 20}}
|
|
68
|
+
} as $orders
|
|
69
|
+
}
|
|
70
|
+
response = $orders
|
|
48
71
|
}`
|
|
49
72
|
},
|
|
50
73
|
{
|
|
@@ -57,19 +80,45 @@ POST /workspace/1/apigroup/1/api
|
|
|
57
80
|
"4. `POST /workspace/{id}/agent` - Create agent with tool references",
|
|
58
81
|
"5. `POST /workspace/{id}/mcp_server` (optional) - Expose via MCP"
|
|
59
82
|
],
|
|
60
|
-
example: `// 1. Create a
|
|
83
|
+
example: `// 1. Create a tool (XanoScript body, Content-Type: text/x-xanoscript)
|
|
61
84
|
POST /workspace/1/tool
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
85
|
+
Content-Type: text/x-xanoscript
|
|
86
|
+
|
|
87
|
+
tool "get_order_status" {
|
|
88
|
+
instructions = "Check the current status of an order by its ID."
|
|
89
|
+
input {
|
|
90
|
+
int order_id { description = "Order ID to check" }
|
|
91
|
+
}
|
|
92
|
+
stack {
|
|
93
|
+
db.get "order" {
|
|
94
|
+
field_name = "id"
|
|
95
|
+
field_value = $input.order_id
|
|
96
|
+
} as $order
|
|
97
|
+
}
|
|
98
|
+
response = {
|
|
99
|
+
order_id: $order.id,
|
|
100
|
+
status: $order.status,
|
|
101
|
+
updated_at: $order.updated_at
|
|
102
|
+
}
|
|
66
103
|
}
|
|
67
104
|
|
|
68
|
-
// 2. Create agent
|
|
105
|
+
// 2. Create the agent that uses it
|
|
69
106
|
POST /workspace/1/agent
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
107
|
+
Content-Type: text/x-xanoscript
|
|
108
|
+
|
|
109
|
+
agent "Customer Support" {
|
|
110
|
+
canonical = "support-agent-v1"
|
|
111
|
+
description = "Handles customer inquiries"
|
|
112
|
+
llm = {
|
|
113
|
+
type: "xano-free"
|
|
114
|
+
system_prompt: "You are a helpful customer support agent."
|
|
115
|
+
prompt: "{{ $args.user_message }}"
|
|
116
|
+
max_steps: 5
|
|
117
|
+
temperature: 0.7
|
|
118
|
+
}
|
|
119
|
+
tools = [
|
|
120
|
+
{ name: "get_order_status" }
|
|
121
|
+
]
|
|
73
122
|
}`
|
|
74
123
|
},
|
|
75
124
|
{
|
|
@@ -87,15 +136,22 @@ POST /workspace/1/agent
|
|
|
87
136
|
description: "Set up automated data maintenance",
|
|
88
137
|
steps: [
|
|
89
138
|
"1. `GET /workspace` - Find workspace ID",
|
|
90
|
-
"2. `POST /workspace/{id}/task` - Create the task
|
|
139
|
+
"2. `POST /workspace/{id}/task` - Create the task: its XanoScript, schedule included, as a `text/x-xanoscript` body",
|
|
91
140
|
"3. Monitor via `GET /workspace/{id}/task_history`"
|
|
92
141
|
],
|
|
93
|
-
example:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
142
|
+
example: `// The schedule lives in the XanoScript (freq in seconds); there is no cron field.
|
|
143
|
+
POST /workspace/1/task
|
|
144
|
+
Content-Type: text/x-xanoscript
|
|
145
|
+
|
|
146
|
+
task "cleanup_old_sessions" {
|
|
147
|
+
description = "Delete sessions older than 30 days, daily at 03:00 UTC"
|
|
148
|
+
stack {
|
|
149
|
+
var $cutoff { value = now|transform_timestamp:"-30 days" }
|
|
150
|
+
db.bulk.delete "session" {
|
|
151
|
+
where = $db.session.created_at < $cutoff
|
|
152
|
+
} as $deleted
|
|
153
|
+
}
|
|
154
|
+
schedule = [{starts_on: 2026-01-01 03:00:00+0000, freq: 86400}]
|
|
99
155
|
}`
|
|
100
156
|
},
|
|
101
157
|
{
|
|
@@ -122,7 +178,7 @@ POST /workspace/1/agent
|
|
|
122
178
|
steps: [
|
|
123
179
|
"1. `POST /workspace/{id}/request_history/search` - Search for failed requests",
|
|
124
180
|
"2. Filter by status: [400, 401, 403, 404, 500]",
|
|
125
|
-
"3. Use
|
|
181
|
+
"3. Use include_output=true to see each request's output (the input is always returned)",
|
|
126
182
|
"4. `GET /workspace/{id}/apigroup/{id}/api/{id}?include_xanoscript=true` - Review endpoint code"
|
|
127
183
|
]
|
|
128
184
|
}
|
|
@@ -126,7 +126,7 @@ export const workspaceDoc = {
|
|
|
126
126
|
{
|
|
127
127
|
method: "GET",
|
|
128
128
|
path: "/workspace/{workspace_id}/openapi",
|
|
129
|
-
tool_name: "
|
|
129
|
+
tool_name: "getWorkspaceOpenApi",
|
|
130
130
|
description: "Get OpenAPI v3 specification for all APIs in the workspace.",
|
|
131
131
|
parameters: [
|
|
132
132
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
@@ -112,12 +112,13 @@ const SYNTAX_SUGGESTIONS = [
|
|
|
112
112
|
/**
|
|
113
113
|
* Enhance error message with helpful suggestions
|
|
114
114
|
*/
|
|
115
|
-
function enhanceErrorMessage(message, code, lineNumber) {
|
|
115
|
+
function enhanceErrorMessage(message, code, lineNumber, scheme) {
|
|
116
116
|
let enhanced = message;
|
|
117
117
|
const lines = code.split("\n");
|
|
118
118
|
const errorLine = lines[lineNumber] || "";
|
|
119
|
-
// Check for type aliases
|
|
120
|
-
|
|
119
|
+
// Check for type aliases, never in a policy: it declares no types, and a value such as
|
|
120
|
+
// object.naming's name_kind: "object" is not one.
|
|
121
|
+
for (const [alias, correct] of scheme === "policy" ? [] : Object.entries(TYPE_ALIASES)) {
|
|
121
122
|
const regex = new RegExp(`\\b${alias}\\b`, "i");
|
|
122
123
|
if (regex.test(errorLine)) {
|
|
123
124
|
enhanced += `\n\n💡 Suggestion: Use "${correct}" instead of "${alias}"`;
|
|
@@ -213,7 +214,7 @@ function validateCode(code, filePath) {
|
|
|
213
214
|
const endLines = text.substring(0, endOffset + 1).split("\n");
|
|
214
215
|
const endLine = endLines.length - 1;
|
|
215
216
|
const endCharacter = endLines[endLines.length - 1].length;
|
|
216
|
-
const enhancedMessage = enhanceErrorMessage(item.message, text, line);
|
|
217
|
+
const enhancedMessage = enhanceErrorMessage(item.message, text, line, scheme);
|
|
217
218
|
return {
|
|
218
219
|
severity,
|
|
219
220
|
range: {
|
|
@@ -451,11 +452,7 @@ export const validateXanoscriptToolSpec = defineTool({
|
|
|
451
452
|
"- file_paths: Array of file paths for batch validation\n" +
|
|
452
453
|
"- directory: Validate all .xs files in a directory\n\n" +
|
|
453
454
|
"Returns errors with line/column positions and helpful suggestions for common mistakes. " +
|
|
454
|
-
"The language server auto-detects the object type from the code syntax.
|
|
455
|
-
"Policy documents (policies/*.xs) are validated too: their syntax and block shape are errors, " +
|
|
456
|
-
"and what the check catalogue decides (an unknown check, field or param, a value outside its set) " +
|
|
457
|
-
"is a warning against the catalogue the language server ships with. The instance decides on save; " +
|
|
458
|
-
"format and check a policy against its branch with xano_parse_policy or `xano policy parse --file <path>`.",
|
|
455
|
+
"The language server auto-detects the object type from the code syntax.",
|
|
459
456
|
annotations: {
|
|
460
457
|
readOnlyHint: true,
|
|
461
458
|
destructiveHint: false,
|
package/dist/xanoscript.js
CHANGED
|
@@ -341,7 +341,6 @@ export function readXanoscriptDocsV2(docsPath, args) {
|
|
|
341
341
|
`- file_path='api/users/create.xs' — auto-select the docs for the file you're editing`,
|
|
342
342
|
`- filter='round' — one expression filter's signature and example (comma-separate for several, e.g. filter='to_upper,split')`,
|
|
343
343
|
`- tier='survival' (~${tiers.survival.tokens}) or tier='working' (~${tiers.working.tokens}) for context-limited models`,
|
|
344
|
-
`- topic='policies' — when the workspace has a policies/ folder: keep to its active mandatory policies while changing code, and evaluate after`,
|
|
345
344
|
`- mode='quick_reference' — compact output when you only need a reminder`,
|
|
346
345
|
`- max_tokens=4000 with file_path= — stop loading once the budget is reached`,
|
|
347
346
|
`- exclude_topics=['syntax'] with file_path= — skip topics you've already loaded`,
|
|
@@ -20,12 +20,17 @@ XanoScript is the declarative scripting language for [Xano](https://xano.com), a
|
|
|
20
20
|
| `agent_trigger` | `ai/agent/trigger/{name}.xs` | Agent event handlers |
|
|
21
21
|
| `tool` | `ai/tool/{name}.xs` | Tools for AI agents |
|
|
22
22
|
| `mcp_server` | `ai/mcp_server/{name}.xs` | MCP server definitions |
|
|
23
|
-
| `prompt` | `
|
|
24
|
-
| `resource` | `
|
|
23
|
+
| `prompt` | `prompt/{name}.xs` | MCP prompts |
|
|
24
|
+
| `resource` | `resource/{name}.xs` | MCP resources |
|
|
25
25
|
| `mcp_server_trigger`| `ai/mcp_server/trigger/{name}.xs` | MCP server event handlers |
|
|
26
26
|
| `workflow_test` | `workflow_test/{name}.xs` | End-to-end workflow tests |
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
27
|
+
| `realtime_server` | `realtime/server/{server}/{server}.xs` | Realtime V2 server |
|
|
28
|
+
| `realtime_server_trigger` | `realtime/server/{server}/trigger/{name}.xs` | Realtime V2 connect/disconnect handlers |
|
|
29
|
+
| `channel` | `realtime/server/{server}/channel/{channel}/{channel}.xs` | Realtime V2 channel |
|
|
30
|
+
| `message` | `realtime/server/{server}/channel/{channel}/message/{name}.xs` | Realtime V2 message handlers |
|
|
31
|
+
| `channel_trigger` | `realtime/server/{server}/channel/{channel}/trigger/{name}.xs` | Realtime V2 join/leave/deliver handlers |
|
|
32
|
+
| `realtime_channel` | `realtime/channel/{name}.xs` | Legacy V1 realtime channel settings |
|
|
33
|
+
| `realtime_trigger` | `realtime/trigger/{name}.xs` | Legacy V1 realtime event handlers |
|
|
29
34
|
| `branch` | `branch.xs` | Branch-level configuration |
|
|
30
35
|
|
|
31
36
|
**Naming convention:** All folder and file names use `snake_case` (e.g., `user_profile.xs`, `get_all_users_get.xs`).
|
|
@@ -72,6 +77,10 @@ project/
|
|
|
72
77
|
│ ├── my_server.xs # MCP server definitions
|
|
73
78
|
│ └── trigger/
|
|
74
79
|
│ └── on_connect.xs # MCP server triggers
|
|
80
|
+
├── prompt/
|
|
81
|
+
│ └── code_review.xs # MCP prompts
|
|
82
|
+
├── resource/
|
|
83
|
+
│ └── order_docs.xs # MCP resources
|
|
75
84
|
├── workflow_test/
|
|
76
85
|
│ └── checkout_flow.xs # End-to-end workflow tests
|
|
77
86
|
├── middleware/
|
|
@@ -79,10 +88,18 @@ project/
|
|
|
79
88
|
├── addon/
|
|
80
89
|
│ └── user_posts.xs # Query addons
|
|
81
90
|
├── realtime/
|
|
91
|
+
│ ├── server/
|
|
92
|
+
│ │ └── chat/
|
|
93
|
+
│ │ ├── chat.xs # Realtime V2 server
|
|
94
|
+
│ │ └── channel/
|
|
95
|
+
│ │ └── rooms_room_id/ # Channel "rooms/{room_id}"
|
|
96
|
+
│ │ ├── rooms_room_id.xs
|
|
97
|
+
│ │ └── message/
|
|
98
|
+
│ │ └── send.xs # Realtime V2 messages
|
|
82
99
|
│ ├── channel/
|
|
83
|
-
│ │ └── chat_room.xs #
|
|
100
|
+
│ │ └── chat_room.xs # Legacy V1 realtime channels
|
|
84
101
|
│ └── trigger/
|
|
85
|
-
│ └── on_message.xs #
|
|
102
|
+
│ └── on_message.xs # Legacy V1 realtime triggers
|
|
86
103
|
├── static/ # Frontend files (HTML, CSS, JS)
|
|
87
104
|
└── run/ # Job and service configurations
|
|
88
105
|
```
|
|
@@ -252,6 +269,7 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
|
|
|
252
269
|
|
|
253
270
|
| Topic | Description | Key Sections |
|
|
254
271
|
| ------------- | --------------------------------------------------- | ------------ |
|
|
272
|
+
| `ai` | Xano AI statements: text, image, video, speech, music, transcription, embeddings, rerank | Choosing a Statement, Billing, Models |
|
|
255
273
|
| `agents` | AI agent configuration with LLM providers and tools | LLM Config, Tool Binding |
|
|
256
274
|
| `tools` | AI tools for agents and MCP servers | Tool Schema, Parameters |
|
|
257
275
|
| `mcp-servers` | MCP server definitions exposing tools | Server Config, Tool Exposure |
|
|
@@ -268,8 +286,7 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
|
|
|
268
286
|
| ------------ | ---------------------------------------------------------------------- | ------------ |
|
|
269
287
|
| `workspace` | Workspace-level settings: environment variables, preferences, realtime | Env Variables, Preferences |
|
|
270
288
|
| `branch` | Branch-level settings: middleware, history retention, visual styling | Middleware Config, History |
|
|
271
|
-
| `middleware` | Request/response interceptors for functions, queries, tasks, and
|
|
272
|
-
| `policies` | Workspace policy documents: syntax, check catalogue, goals, authoring rules | Quick Reference, Permissions |
|
|
289
|
+
| `middleware` | Request/response interceptors for functions, queries, tasks, tools, realtime messages, and MCP prompts and resources | Pre/Post Hooks |
|
|
273
290
|
|
|
274
291
|
### Development
|
|
275
292
|
|
|
@@ -6,7 +6,7 @@ applyTo: "ai/agent/*.xs"
|
|
|
6
6
|
|
|
7
7
|
AI-powered agents that use LLMs to perform tasks autonomously.
|
|
8
8
|
|
|
9
|
-
> **TL;DR:** Define with `agent "name" { llm = { type: "provider", system_prompt: "...", prompt: "..." } tools = [...] }`. Providers: `xano-
|
|
9
|
+
> **TL;DR:** Define with `agent "name" { llm = { type: "provider", system_prompt: "...", prompt: "..." } tools = [...] }`. Providers: `xano-ai`, `openai`, `anthropic`, `google-genai` (`xano-free` is deprecated). Tools give agents capabilities.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -29,7 +29,8 @@ agent "<name>" {
|
|
|
29
29
|
### LLM Providers
|
|
30
30
|
| Provider | Type Value |
|
|
31
31
|
|----------|------------|
|
|
32
|
-
| Xano
|
|
32
|
+
| Xano AI (charged in credits) | `xano-ai` |
|
|
33
|
+
| Xano Free (deprecated, runs as Xano AI) | `xano-free` |
|
|
33
34
|
| Google Gemini | `google-genai` |
|
|
34
35
|
| OpenAI | `openai` |
|
|
35
36
|
| Anthropic | `anthropic` |
|
|
@@ -43,7 +44,7 @@ agent "Customer Support" {
|
|
|
43
44
|
canonical = "support-agent-v1"
|
|
44
45
|
description = "Handles customer inquiries"
|
|
45
46
|
llm = {
|
|
46
|
-
type: "xano-
|
|
47
|
+
type: "xano-ai"
|
|
47
48
|
system_prompt: "You are a helpful customer support agent."
|
|
48
49
|
prompt: "{{ $args.user_message }}"
|
|
49
50
|
max_steps: 5
|
|
@@ -60,6 +61,8 @@ agent "Customer Support" {
|
|
|
60
61
|
|
|
61
62
|
## Calling Agents
|
|
62
63
|
|
|
64
|
+
> **One-shot call?** A single prompt-to-answer (summarize, classify, extract JSON, generate an image, embed text) does not need an agent: use `ai.text.generate` and the other Xano AI statements (`xano_xanoscript_docs({ topic: "ai" })`). Use `ai.agent.run` when the model needs tools or multiple steps.
|
|
65
|
+
|
|
63
66
|
```xs
|
|
64
67
|
ai.agent.run "Customer Support" {
|
|
65
68
|
args = {}|set:"user_message":$input.message
|
|
@@ -90,18 +93,23 @@ llm = {
|
|
|
90
93
|
|
|
91
94
|
## Provider Configurations
|
|
92
95
|
|
|
93
|
-
### Xano
|
|
96
|
+
### Xano AI
|
|
97
|
+
Runs on Xano's own models and is charged in AI credits, so it needs no API key. It uses Xano AI's default model; there is no `model` field.
|
|
94
98
|
```xs
|
|
95
99
|
llm = {
|
|
96
|
-
type: "xano-
|
|
100
|
+
type: "xano-ai"
|
|
97
101
|
system_prompt: "You are a helpful assistant."
|
|
98
102
|
prompt: "{{ $args.message }}"
|
|
99
103
|
max_steps: 3
|
|
100
104
|
temperature: 0
|
|
101
105
|
search_grounding: false // Google Search grounding
|
|
106
|
+
location: "eu" // Optional: "us", "global" or "eu"; omit for the workspace default
|
|
102
107
|
}
|
|
103
108
|
```
|
|
104
109
|
|
|
110
|
+
### Xano Free (deprecated)
|
|
111
|
+
`type: "xano-free"` is still valid, so existing agents keep working, but the validator marks it deprecated. Where Xano AI is available, a `xano-free` agent runs as Xano AI: charged in credits, on Xano AI's default model and the workspace's location. Write new agents with `type: "xano-ai"`.
|
|
112
|
+
|
|
105
113
|
### Google Gemini
|
|
106
114
|
```xs
|
|
107
115
|
llm = {
|
|
@@ -387,6 +395,7 @@ agent "Research Agent" {
|
|
|
387
395
|
|
|
388
396
|
| Topic | Description |
|
|
389
397
|
|-------|-------------|
|
|
398
|
+
| `ai` | One-shot Xano AI statements (`ai.text.generate`, `ai.image.generate`, ...) |
|
|
390
399
|
| `tools` | Functions that agents can execute |
|
|
391
400
|
| `mcp-servers` | MCP server configuration |
|
|
392
401
|
| `triggers` | Agent triggers for events |
|