@xano/developer-mcp 2.3.0-beta.10 → 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.
@@ -43,6 +43,9 @@ function formatEndpoint(ep, detailLevel) {
43
43
  if (ep.request_body) {
44
44
  lines.push("");
45
45
  lines.push(`**Request Body:** \`${ep.request_body.type}\``);
46
+ if (ep.request_body.description) {
47
+ lines.push(ep.request_body.description);
48
+ }
46
49
  if (ep.request_body.properties) {
47
50
  for (const [key, val] of Object.entries(ep.request_body.properties)) {
48
51
  const req = val.required ? " (required)" : "";
@@ -56,13 +59,23 @@ function formatEndpoint(ep, detailLevel) {
56
59
  lines.push("**Example:**");
57
60
  lines.push("```");
58
61
  lines.push(`${ep.example.method} ${ep.example.path}`);
62
+ if (ep.example.headers) {
63
+ for (const [key, val] of Object.entries(ep.example.headers)) {
64
+ lines.push(`${key}: ${val}`);
65
+ }
66
+ }
59
67
  if (ep.example.body) {
60
- lines.push(JSON.stringify(ep.example.body, null, 2));
68
+ lines.push("");
69
+ lines.push(formatBody(ep.example.body));
61
70
  }
62
71
  lines.push("```");
63
72
  }
64
73
  return lines.join("\n");
65
74
  }
75
+ // A string body (a XanoScript request) is printed as sent; anything else as JSON.
76
+ function formatBody(body) {
77
+ return typeof body === "string" ? body : JSON.stringify(body, null, 2);
78
+ }
66
79
  function formatExample(ex) {
67
80
  const lines = [];
68
81
  lines.push(`### ${ex.title}`);
@@ -79,7 +92,7 @@ function formatExample(ex) {
79
92
  }
80
93
  if (ex.request.body) {
81
94
  lines.push("");
82
- lines.push(JSON.stringify(ex.request.body, null, 2));
95
+ lines.push(formatBody(ex.request.body));
83
96
  }
84
97
  lines.push("```");
85
98
  if (ex.response !== undefined) {
@@ -58,30 +58,27 @@ export const agentDoc = {
58
58
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
59
59
  ],
60
60
  request_body: {
61
- type: "application/json",
62
- properties: {
63
- name: { type: "string", description: "Agent name", required: true },
64
- description: { type: "string", description: "Agent description" },
65
- xanoscript: { type: "string", description: "XanoScript agent definition", required: true }
66
- }
61
+ type: "text/x-xanoscript",
62
+ description: "The agent as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, LLM settings and tools 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 agent without its code."
67
63
  },
68
64
  example: {
69
65
  method: "POST",
70
66
  path: "/workspace/1/agent",
71
- body: {
72
- name: "support_agent",
73
- description: "Customer support AI agent",
74
- xanoscript: `agent support_agent {
75
- llm {
76
- type = "anthropic"
77
- model = "claude-4-sonnet-20250514"
78
- system_prompt = "You are a helpful customer support agent."
79
- max_steps = 10
80
- temperature = 0.3
67
+ headers: { "Content-Type": "text/x-xanoscript" },
68
+ body: `agent "Customer Support" {
69
+ canonical = "support-agent-v1"
70
+ description = "Handles customer inquiries"
71
+ llm = {
72
+ type: "xano-free"
73
+ system_prompt: "You are a helpful customer support agent."
74
+ prompt: "{{ $args.user_message }}"
75
+ max_steps: 5
76
+ temperature: 0.7
81
77
  }
82
- tools = [lookup_order, update_ticket]
78
+ tools = [
79
+ { name: "get_order_status" }
80
+ ]
83
81
  }`
84
- }
85
82
  }
86
83
  },
87
84
  {
@@ -95,12 +92,27 @@ export const agentDoc = {
95
92
  { name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
96
93
  ],
97
94
  request_body: {
98
- type: "application/json",
99
- properties: {
100
- name: { type: "string", description: "Agent name" },
101
- description: { type: "string", description: "Agent description" },
102
- xanoscript: { type: "string", description: "XanoScript agent definition" }
103
- }
95
+ type: "text/x-xanoscript",
96
+ description: "The whole agent 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 agent's code."
97
+ },
98
+ example: {
99
+ method: "PUT",
100
+ path: "/workspace/1/agent/2",
101
+ headers: { "Content-Type": "text/x-xanoscript" },
102
+ body: `agent "Customer Support" {
103
+ canonical = "support-agent-v1"
104
+ description = "Handles customer inquiries"
105
+ llm = {
106
+ type: "xano-free"
107
+ system_prompt: "You are a helpful customer support agent."
108
+ prompt: "{{ $args.user_message }}"
109
+ max_steps: 5
110
+ temperature: 0.7
111
+ }
112
+ tools = [
113
+ { name: "get_order_status" }
114
+ ]
115
+ }`
104
116
  }
105
117
  },
106
118
  {
@@ -53,24 +53,25 @@ export const apiDoc = {
53
53
  { name: "apigroup_id", type: "integer", required: true, in: "path", description: "API Group ID" }
54
54
  ],
55
55
  request_body: {
56
- type: "application/json",
57
- properties: {
58
- name: { type: "string", description: "Endpoint name", required: true },
59
- path: { type: "string", description: "URL path (e.g., /users/{id})", required: true },
60
- verb: { type: "string", description: "HTTP method: GET, POST, PUT, DELETE", required: true },
61
- description: { type: "string", description: "Endpoint description" },
62
- xanoscript: { type: "string", description: "XanoScript code defining the endpoint logic" }
63
- }
56
+ type: "text/x-xanoscript",
57
+ description: "The endpoint as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, verb, path, inputs and response come from the script (`query \"<path>\" verb=<VERB> { ... }`). A JSON body's `xanoscript` field is not read: the route drops fields it does not declare, so a JSON request creates the endpoint without its code."
64
58
  },
65
59
  example: {
66
60
  method: "POST",
67
61
  path: "/workspace/1/apigroup/2/api",
68
- body: {
69
- name: "getUsers",
70
- path: "/users",
71
- verb: "GET",
72
- xanoscript: "query getUsers {\n response = db.users.query().all()\n}"
73
- }
62
+ headers: { "Content-Type": "text/x-xanoscript" },
63
+ body: `query "orders" verb=GET {
64
+ description = "List orders, 20 a page"
65
+ input {
66
+ int page?=1
67
+ }
68
+ stack {
69
+ db.query "order" {
70
+ return = {type: "list", paging: {page: $input.page, per_page: 20}}
71
+ } as $orders
72
+ }
73
+ response = $orders
74
+ }`
74
75
  }
75
76
  },
76
77
  {
@@ -85,14 +86,25 @@ export const apiDoc = {
85
86
  { name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
86
87
  ],
87
88
  request_body: {
88
- type: "application/json",
89
- properties: {
90
- name: { type: "string", description: "Endpoint name" },
91
- path: { type: "string", description: "URL path" },
92
- verb: { type: "string", description: "HTTP method" },
93
- description: { type: "string", description: "Endpoint description" },
94
- xanoscript: { type: "string", description: "XanoScript code" }
95
- }
89
+ type: "text/x-xanoscript",
90
+ description: "The whole endpoint 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 endpoint's code."
91
+ },
92
+ example: {
93
+ method: "PUT",
94
+ path: "/workspace/1/apigroup/2/api/7",
95
+ headers: { "Content-Type": "text/x-xanoscript" },
96
+ body: `query "orders" verb=GET {
97
+ description = "List orders, 20 a page"
98
+ input {
99
+ int page?=1
100
+ }
101
+ stack {
102
+ db.query "order" {
103
+ return = {type: "list", paging: {page: $input.page, per_page: 20}}
104
+ } as $orders
105
+ }
106
+ response = $orders
107
+ }`
96
108
  }
97
109
  },
98
110
  {
@@ -142,32 +154,27 @@ export const apiDoc = {
142
154
  examples: [
143
155
  {
144
156
  title: "Create a GET endpoint",
145
- description: "Create a simple endpoint to list all users",
157
+ description: "Create an endpoint that lists orders, 20 a page. The endpoint is the request body, as XanoScript.",
146
158
  request: {
147
159
  method: "POST",
148
160
  path: "/workspace/1/apigroup/2/api",
149
- body: {
150
- name: "listUsers",
151
- path: "/users",
152
- verb: "GET",
153
- xanoscript: `query listUsers {
161
+ headers: { "Content-Type": "text/x-xanoscript" },
162
+ body: `query "orders" verb=GET {
163
+ description = "List orders, 20 a page"
154
164
  input {
155
- int page = 1
156
- int per_page = 20
165
+ int page?=1
157
166
  }
158
167
  stack {
159
- var $users {
160
- value = db.users.query().paginate($input.page, $input.per_page)
161
- }
168
+ db.query "order" {
169
+ return = {type: "list", paging: {page: $input.page, per_page: 20}}
170
+ } as $orders
162
171
  }
163
- response = $users
172
+ response = $orders
164
173
  }`
165
- }
166
174
  },
167
175
  response: {
168
176
  id: 123,
169
- name: "listUsers",
170
- path: "/users",
177
+ name: "orders",
171
178
  verb: "GET"
172
179
  }
173
180
  }
@@ -63,35 +63,24 @@ Functions can cache results based on:
63
63
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
64
64
  ],
65
65
  request_body: {
66
- type: "application/json",
67
- properties: {
68
- name: { type: "string", description: "Function name", required: true },
69
- description: { type: "string", description: "Function description" },
70
- xanoscript: { type: "string", description: "XanoScript function definition", required: true }
71
- }
66
+ type: "text/x-xanoscript",
67
+ description: "The function as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, description, 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 function without its code."
72
68
  },
73
69
  example: {
74
70
  method: "POST",
75
71
  path: "/workspace/1/function",
76
- body: {
77
- name: "calculate_total",
78
- description: "Calculate order total with tax",
79
- xanoscript: `function calculate_total {
72
+ headers: { "Content-Type": "text/x-xanoscript" },
73
+ body: `function "calculate_total" {
74
+ description = "Order total for a quantity at a unit price"
80
75
  input {
81
- decimal subtotal
82
- decimal tax_rate = 0.08
76
+ int quantity filters=min:0
77
+ decimal price filters=min:0
83
78
  }
84
79
  stack {
85
- var $tax {
86
- value = $input.subtotal * $input.tax_rate
87
- }
88
- var $total {
89
- value = $input.subtotal + $tax
90
- }
80
+ var $total { value = $input.quantity * $input.price }
91
81
  }
92
82
  response = $total
93
83
  }`
94
- }
95
84
  }
96
85
  },
97
86
  {
@@ -105,12 +94,24 @@ Functions can cache results based on:
105
94
  { name: "publish", type: "boolean", default: true, description: "Publish changes immediately (false saves as draft)" }
106
95
  ],
107
96
  request_body: {
108
- type: "application/json",
109
- properties: {
110
- name: { type: "string", description: "Function name" },
111
- description: { type: "string", description: "Function description" },
112
- xanoscript: { type: "string", description: "XanoScript function definition" }
113
- }
97
+ type: "text/x-xanoscript",
98
+ description: "The whole function 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 function's code."
99
+ },
100
+ example: {
101
+ method: "PUT",
102
+ path: "/workspace/1/function/12",
103
+ headers: { "Content-Type": "text/x-xanoscript" },
104
+ body: `function "calculate_total" {
105
+ description = "Order total for a quantity at a unit price"
106
+ input {
107
+ int quantity filters=min:0
108
+ decimal price filters=min:0
109
+ }
110
+ stack {
111
+ var $total { value = $input.quantity * $input.price }
112
+ }
113
+ response = $total
114
+ }`
114
115
  }
115
116
  },
116
117
  {
@@ -58,27 +58,17 @@ export const mcpServerDoc = {
58
58
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
59
59
  ],
60
60
  request_body: {
61
- type: "application/json",
62
- properties: {
63
- name: { type: "string", description: "MCP server name", required: true },
64
- description: { type: "string", description: "MCP server description" },
65
- xanoscript: { type: "string", description: "XanoScript MCP server definition", required: true }
66
- }
61
+ type: "text/x-xanoscript",
62
+ description: "The MCP server as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name and the tools, prompts and resources it exposes 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 MCP server without its code."
67
63
  },
68
64
  example: {
69
65
  method: "POST",
70
66
  path: "/workspace/1/mcp_server",
71
- body: {
72
- name: "my_tools",
73
- description: "MCP server exposing customer support tools",
74
- xanoscript: `mcp_server my_tools {
75
- tools = [lookup_order, update_ticket, send_notification]
76
- authentication {
77
- type = "bearer"
78
- token = env.MCP_TOKEN
79
- }
67
+ headers: { "Content-Type": "text/x-xanoscript" },
68
+ body: `mcp_server "Orders" {
69
+ canonical = "orders-mcp"
70
+ tools = [{ name: "get_order_status" }]
80
71
  }`
81
- }
82
72
  }
83
73
  },
84
74
  {
@@ -91,12 +81,17 @@ export const mcpServerDoc = {
91
81
  { name: "mcp_server_id", type: "integer", required: true, in: "path", description: "MCP Server ID" }
92
82
  ],
93
83
  request_body: {
94
- type: "application/json",
95
- properties: {
96
- name: { type: "string", description: "MCP server name" },
97
- description: { type: "string", description: "MCP server description" },
98
- xanoscript: { type: "string", description: "XanoScript MCP server definition" }
99
- }
84
+ type: "text/x-xanoscript",
85
+ description: "The whole MCP server 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 MCP server's code."
86
+ },
87
+ example: {
88
+ method: "PUT",
89
+ path: "/workspace/1/mcp_server/1",
90
+ headers: { "Content-Type": "text/x-xanoscript" },
91
+ body: `mcp_server "Orders" {
92
+ canonical = "orders-mcp"
93
+ tools = [{ name: "get_order_status" }]
94
+ }`
100
95
  }
101
96
  },
102
97
  {
@@ -58,38 +58,27 @@ export const middlewareDoc = {
58
58
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
59
59
  ],
60
60
  request_body: {
61
- type: "application/json",
62
- properties: {
63
- name: { type: "string", description: "Middleware name", required: true },
64
- description: { type: "string", description: "Middleware description" },
65
- type: { type: "string", description: "pre or post", required: true },
66
- xanoscript: { type: "string", description: "XanoScript middleware definition", required: true }
67
- }
61
+ type: "text/x-xanoscript",
62
+ description: "The middleware as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, policies, 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 middleware without its code."
68
63
  },
69
64
  example: {
70
65
  method: "POST",
71
66
  path: "/workspace/1/middleware",
72
- body: {
73
- name: "rate_limiter",
74
- description: "Limit requests to 100 per minute per IP",
75
- type: "pre",
76
- xanoscript: `middleware rate_limiter {
77
- stack {
78
- var $key {
79
- value = "ratelimit:" + $request.ip
80
- }
81
- var $count {
82
- value = redis.incr($key)
83
- }
84
- if ($count == 1) {
85
- redis.expire($key, 60)
86
- }
87
- if ($count > 100) {
88
- throw(429, "Rate limit exceeded")
67
+ headers: { "Content-Type": "text/x-xanoscript" },
68
+ body: `middleware "wrap_response" {
69
+ exception_policy = "rethrow"
70
+ response_strategy = "replace"
71
+ input {
72
+ json vars
73
+ enum type {
74
+ values = ["pre", "post"]
89
75
  }
90
76
  }
77
+ stack {
78
+ var $payload { value = $input.vars.result }
79
+ }
80
+ response = {success: true, payload: $payload}
91
81
  }`
92
- }
93
82
  }
94
83
  },
95
84
  {
@@ -103,12 +92,27 @@ export const middlewareDoc = {
103
92
  { name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
104
93
  ],
105
94
  request_body: {
106
- type: "application/json",
107
- properties: {
108
- name: { type: "string", description: "Middleware name" },
109
- description: { type: "string", description: "Middleware description" },
110
- xanoscript: { type: "string", description: "XanoScript middleware definition" }
111
- }
95
+ type: "text/x-xanoscript",
96
+ description: "The whole middleware 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 middleware's code."
97
+ },
98
+ example: {
99
+ method: "PUT",
100
+ path: "/workspace/1/middleware/3",
101
+ headers: { "Content-Type": "text/x-xanoscript" },
102
+ body: `middleware "wrap_response" {
103
+ exception_policy = "rethrow"
104
+ response_strategy = "replace"
105
+ input {
106
+ json vars
107
+ enum type {
108
+ values = ["pre", "post"]
109
+ }
110
+ }
111
+ stack {
112
+ var $payload { value = $input.vars.result }
113
+ }
114
+ response = {success: true, payload: $payload}
115
+ }`
112
116
  }
113
117
  },
114
118
  {
@@ -59,25 +59,29 @@ export const tableDoc = {
59
59
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
60
60
  ],
61
61
  request_body: {
62
- type: "application/json",
63
- properties: {
64
- name: { type: "string", description: "Table name", required: true },
65
- description: { type: "string", description: "Table description" },
66
- xanoscript: { type: "string", description: "XanoScript table definition with schema" }
67
- }
62
+ type: "text/x-xanoscript",
63
+ description: "The table as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, schema and indexes come from the script. To start from an empty table instead, send JSON `{\"name\": \"...\"}` and add fields with the schema endpoints below. A JSON body's `xanoscript` field is not read: the route drops fields it does not declare, so a JSON request creates the table without the schema in it."
68
64
  },
69
65
  example: {
70
66
  method: "POST",
71
67
  path: "/workspace/1/table",
72
- body: {
73
- name: "users",
74
- xanoscript: `table users {
75
- id int [pk, auto]
76
- email text [unique]
77
- name text
78
- created_at timestamp [default:now]
68
+ headers: { "Content-Type": "text/x-xanoscript" },
69
+ body: `table "user" {
70
+ auth = true
71
+ schema {
72
+ int id
73
+ timestamp created_at?=now
74
+ text name filters=trim
75
+ email email filters=trim|lower {
76
+ sensitive = true
77
+ }
78
+ password password
79
+ }
80
+ index = [
81
+ {type: "primary", field: [{name: "id"}]}
82
+ {type: "btree|unique", field: [{name: "email"}]}
83
+ ]
79
84
  }`
80
- }
81
85
  }
82
86
  },
83
87
  {
@@ -90,12 +94,29 @@ export const tableDoc = {
90
94
  { name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" }
91
95
  ],
92
96
  request_body: {
93
- type: "application/json",
94
- properties: {
95
- name: { type: "string", description: "Table name" },
96
- description: { type: "string", description: "Table description" },
97
- xanoscript: { type: "string", description: "Updated XanoScript definition" }
98
- }
97
+ type: "text/x-xanoscript",
98
+ description: "The whole table 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 table's schema."
99
+ },
100
+ example: {
101
+ method: "PUT",
102
+ path: "/workspace/1/table/3",
103
+ headers: { "Content-Type": "text/x-xanoscript" },
104
+ body: `table "user" {
105
+ auth = true
106
+ schema {
107
+ int id
108
+ timestamp created_at?=now
109
+ text name filters=trim
110
+ email email filters=trim|lower {
111
+ sensitive = true
112
+ }
113
+ password password
114
+ }
115
+ index = [
116
+ {type: "primary", field: [{name: "id"}]}
117
+ {type: "btree|unique", field: [{name: "email"}]}
118
+ ]
119
+ }`
99
120
  }
100
121
  },
101
122
  {
@@ -1,10 +1,10 @@
1
1
  export const taskDoc = {
2
2
  topic: "task",
3
3
  title: "Scheduled Task Management",
4
- description: `Tasks are scheduled jobs that run automatically based on a cron schedule. They're used for background processing, periodic data sync, automated maintenance, and more.
4
+ description: `Tasks are scheduled jobs that run automatically on a schedule: a start time and a repeat frequency in seconds, written in the task's XanoScript. They're used for background processing, periodic data sync, automated maintenance, and more.
5
5
 
6
6
  ## Key Concepts
7
- - Tasks run on a schedule (cron syntax)
7
+ - Tasks run on the schedule in their XanoScript: \`schedule = [{starts_on: 2026-01-01 03:00:00+0000, freq: 86400}]\` (freq in seconds; add \`ends_on\` to stop; several entries for several times)
8
8
  - No HTTP trigger - runs automatically
9
9
  - Can access databases, call functions, make external requests
10
10
  - Support draft/publish workflow
@@ -17,7 +17,9 @@ export const taskDoc = {
17
17
  - Notification sending
18
18
  - Cache warming`,
19
19
  ai_hints: `- Tasks require paid account (will fail on free tier)
20
- - Use cron syntax for scheduling (e.g., "0 * * * *" for hourly)
20
+ - Create and update a task by sending its XanoScript as the raw body with \`Content-Type: text/x-xanoscript\`. The schedule, the \`active\` flag and the stack all live in the script; there is no cron field
21
+ - A JSON body with a \`xanoscript\` field creates a task with no stack and no schedule (the field is dropped silently), so it never runs
22
+ - Schedule frequency is in seconds: 3600 hourly, 86400 daily, 604800 weekly
21
23
  - Tasks have no HTTP inputs - all data comes from database or environment
22
24
  - Draft changes won't affect running schedule until published
23
25
  - Check task history to debug execution issues`,
@@ -60,34 +62,23 @@ export const taskDoc = {
60
62
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
61
63
  ],
62
64
  request_body: {
63
- type: "application/json",
64
- properties: {
65
- name: { type: "string", description: "Task name", required: true },
66
- description: { type: "string", description: "Task description" },
67
- schedule: { type: "string", description: "Cron expression (e.g., '0 * * * *' for hourly)", required: true },
68
- active: { type: "boolean", description: "Whether task is active", required: true },
69
- xanoscript: { type: "string", description: "XanoScript task definition", required: true }
70
- }
65
+ type: "text/x-xanoscript",
66
+ description: "The task as XanoScript, sent as the raw request body with `Content-Type: text/x-xanoscript`. Its name, description, `active` flag and schedule (`schedule = [{starts_on, freq}]`, freq in seconds) 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 task without its code."
71
67
  },
72
68
  example: {
73
69
  method: "POST",
74
70
  path: "/workspace/1/task",
75
- body: {
76
- name: "cleanup_old_sessions",
77
- description: "Delete sessions older than 30 days",
78
- schedule: "0 3 * * *",
79
- active: true,
80
- xanoscript: `task cleanup_old_sessions {
71
+ headers: { "Content-Type": "text/x-xanoscript" },
72
+ body: `task "cleanup_old_sessions" {
73
+ description = "Delete sessions older than 30 days, daily at 03:00 UTC"
81
74
  stack {
82
- var $cutoff {
83
- value = now|transform_timestamp:"-30 days"
84
- }
85
- db.bulk.delete "sessions" {
86
- where = $db.sessions.created_at < $cutoff
87
- } as $deleted_count
75
+ var $cutoff { value = now|transform_timestamp:"-30 days" }
76
+ db.bulk.delete "session" {
77
+ where = $db.session.created_at < $cutoff
78
+ } as $deleted
88
79
  }
80
+ schedule = [{starts_on: 2026-01-01 03:00:00+0000, freq: 86400}]
89
81
  }`
90
- }
91
82
  }
92
83
  },
93
84
  {
@@ -101,14 +92,24 @@ export const taskDoc = {
101
92
  { name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
102
93
  ],
103
94
  request_body: {
104
- type: "application/json",
105
- properties: {
106
- name: { type: "string", description: "Task name" },
107
- description: { type: "string", description: "Task description" },
108
- schedule: { type: "string", description: "Cron expression" },
109
- active: { type: "boolean", description: "Whether task is active" },
110
- xanoscript: { type: "string", description: "XanoScript task definition" }
111
- }
95
+ type: "text/x-xanoscript",
96
+ description: "The whole task 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 task's code."
97
+ },
98
+ example: {
99
+ method: "PUT",
100
+ path: "/workspace/1/task/4",
101
+ headers: { "Content-Type": "text/x-xanoscript" },
102
+ body: `task "cleanup_old_sessions" {
103
+ description = "Delete sessions older than 30 days, every 6 hours, paused"
104
+ active = false
105
+ stack {
106
+ var $cutoff { value = now|transform_timestamp:"-30 days" }
107
+ db.bulk.delete "session" {
108
+ where = $db.session.created_at < $cutoff
109
+ } as $deleted
110
+ }
111
+ schedule = [{starts_on: 2026-01-01 00:00:00+0000, freq: 21600}]
112
+ }`
112
113
  }
113
114
  },
114
115
  {
@@ -145,20 +146,19 @@ export const taskDoc = {
145
146
  id: { type: "integer" },
146
147
  name: { type: "string" },
147
148
  description: { type: "string" },
148
- schedule: { type: "string", description: "Cron expression" },
149
+ datasource: { type: "string" },
149
150
  active: { type: "boolean" },
150
151
  xanoscript: { type: "string" },
151
152
  created_at: { type: "string", format: "date-time" },
152
153
  updated_at: { type: "string", format: "date-time" }
153
154
  }
154
155
  },
155
- CronExamples: {
156
- "every_minute": "* * * * *",
157
- "every_hour": "0 * * * *",
158
- "every_day_midnight": "0 0 * * *",
159
- "every_day_3am": "0 3 * * *",
160
- "every_monday": "0 0 * * 1",
161
- "first_of_month": "0 0 1 * *"
156
+ ScheduleExamples: {
157
+ "hourly": "schedule = [{starts_on: 2026-01-01 00:00:00+0000, freq: 3600}]",
158
+ "daily_3am_utc": "schedule = [{starts_on: 2026-01-01 03:00:00+0000, freq: 86400}]",
159
+ "weekly_monday": "schedule = [{starts_on: 2026-01-05 00:00:00+0000, freq: 604800}]",
160
+ "twice_daily": "schedule = [{starts_on: 2026-01-01 09:00:00+0000, freq: 86400}, {starts_on: 2026-01-01 21:00:00+0000, freq: 86400}]",
161
+ "until_year_end": "schedule = [{starts_on: 2026-01-01 08:00:00+0000, freq: 3600, ends_on: 2026-12-31 23:59:59+0000}]"
162
162
  }
163
163
  },
164
164
  related_topics: ["function", "history"]
@@ -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: "application/json",
63
- properties: {
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
- body: {
73
- name: "lookup_order",
74
- description: "Look up an order by order ID or customer email",
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
- var $order {
82
- value = db.orders.query()
83
- .where("id", "=", $input.order_id)
84
- .or("customer_email", "=", $input.email)
85
- .first()
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: "application/json",
105
- properties: {
106
- name: { type: "string", description: "Tool name" },
107
- description: { type: "string", description: "Tool description" },
108
- xanoscript: { type: "string", description: "XanoScript tool definition" }
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: Create users table and list endpoint
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
- "name": "users",
38
- "xanoscript": "table users {\\n id int [pk, auto]\\n email text [unique]\\n name text\\n created_at timestamp [default:now]\\n}"
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
- "name": "listUsers",
45
- "path": "/users",
46
- "verb": "GET",
47
- "xanoscript": "query listUsers {\\n response = db.users.query().all()\\n}"
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 lookup tool
83
+ example: `// 1. Create a tool (XanoScript body, Content-Type: text/x-xanoscript)
61
84
  POST /workspace/1/tool
62
- {
63
- "name": "lookup_customer",
64
- "description": "Look up customer by email or ID",
65
- "xanoscript": "tool lookup_customer {\\n input { text email? int id? }\\n response = db.customers.query().where('email', '=', $input.email).or('id', '=', $input.id).first()\\n}"
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
- "name": "support_bot",
72
- "xanoscript": "agent support_bot {\\n llm {\\n type = \\"anthropic\\"\\n model = \\"claude-4-sonnet-20250514\\"\\n system_prompt = \\"You help customers with their orders.\\"\\n }\\n tools = [lookup_customer]\\n}"
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 with schedule",
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: `POST /workspace/1/task
94
- {
95
- "name": "cleanup_old_sessions",
96
- "schedule": "0 3 * * *",
97
- "active": true,
98
- "xanoscript": "task cleanup_old_sessions {\\n stack {\\n var $cutoff {\\n value = now|transform_timestamp:\\"-30 days\\"\\n }\\n db.bulk.delete \\"sessions\\" {\\n where = $db.sessions.created_at < $cutoff\\n } as $deleted_count\\n }\\n}"
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
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/developer-mcp",
3
- "version": "2.3.0-beta.10",
3
+ "version": "2.3.0-beta.11",
4
4
  "description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
5
5
  "mcpName": "io.github.xano-inc/xano-developer-mcp",
6
6
  "type": "module",