@xano/developer-mcp 1.0.27 → 1.0.29
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 +1 -1
- package/dist/api_docs/format.d.ts +5 -0
- package/dist/api_docs/format.js +171 -0
- package/dist/api_docs/index.d.ts +52 -0
- package/dist/api_docs/index.js +111 -0
- package/dist/api_docs/topics/agent.d.ts +2 -0
- package/dist/api_docs/topics/agent.js +142 -0
- package/dist/api_docs/topics/api.d.ts +2 -0
- package/dist/api_docs/topics/api.js +176 -0
- package/dist/api_docs/topics/apigroup.d.ts +2 -0
- package/dist/api_docs/topics/apigroup.js +124 -0
- package/dist/api_docs/topics/authentication.d.ts +2 -0
- package/dist/api_docs/topics/authentication.js +61 -0
- package/dist/api_docs/topics/branch.d.ts +2 -0
- package/dist/api_docs/topics/branch.js +73 -0
- package/dist/api_docs/topics/file.d.ts +2 -0
- package/dist/api_docs/topics/file.js +70 -0
- package/dist/api_docs/topics/function.d.ts +2 -0
- package/dist/api_docs/topics/function.js +164 -0
- package/dist/api_docs/topics/history.d.ts +2 -0
- package/dist/api_docs/topics/history.js +149 -0
- package/dist/api_docs/topics/mcp_server.d.ts +2 -0
- package/dist/api_docs/topics/mcp_server.js +139 -0
- package/dist/api_docs/topics/middleware.d.ts +2 -0
- package/dist/api_docs/topics/middleware.js +156 -0
- package/dist/api_docs/topics/realtime.d.ts +2 -0
- package/dist/api_docs/topics/realtime.js +112 -0
- package/dist/api_docs/topics/start.d.ts +2 -0
- package/dist/api_docs/topics/start.js +107 -0
- package/dist/api_docs/topics/table.d.ts +2 -0
- package/dist/api_docs/topics/table.js +195 -0
- package/dist/api_docs/topics/task.d.ts +2 -0
- package/dist/api_docs/topics/task.js +165 -0
- package/dist/api_docs/topics/tool.d.ts +2 -0
- package/dist/api_docs/topics/tool.js +150 -0
- package/dist/api_docs/topics/workflows.d.ts +2 -0
- package/dist/api_docs/topics/workflows.js +131 -0
- package/dist/api_docs/topics/workspace.d.ts +2 -0
- package/dist/api_docs/topics/workspace.js +153 -0
- package/dist/api_docs/types.d.ts +79 -0
- package/dist/api_docs/types.js +4 -0
- package/dist/meta_api_docs/topics/branch.js +154 -18
- package/dist/meta_api_docs/topics/workspace.js +45 -2
- package/dist/templates/init-workspace.d.ts +10 -0
- package/dist/templates/init-workspace.js +278 -0
- package/dist/templates/xanoscript-index.d.ts +11 -0
- package/dist/templates/xanoscript-index.js +72 -0
- package/dist/xanoscript_docs/README.md +3 -13
- package/dist/xanoscript_docs/ephemeral.md +330 -0
- package/dist/xanoscript_docs/functions.md +0 -21
- package/dist/xanoscript_docs/integrations.md +0 -10
- package/dist/xanoscript_docs/performance.md +1 -10
- package/dist/xanoscript_docs/realtime.md +1 -48
- package/dist/xanoscript_docs/security.md +2 -0
- package/dist/xanoscript_docs/tools.md +2 -21
- package/dist/xanoscript_docs/triggers.md +2 -27
- package/dist/xanoscript_docs_auto/README.md +119 -0
- package/dist/xanoscript_docs_auto/agents.md +446 -0
- package/dist/xanoscript_docs_auto/apis.md +517 -0
- package/dist/xanoscript_docs_auto/control-flow.md +543 -0
- package/dist/xanoscript_docs_auto/database.md +551 -0
- package/dist/xanoscript_docs_auto/debugging.md +527 -0
- package/dist/xanoscript_docs_auto/filters.md +464 -0
- package/dist/xanoscript_docs_auto/functions.md +431 -0
- package/dist/xanoscript_docs_auto/integrations.md +657 -0
- package/dist/xanoscript_docs_auto/mcp-servers.md +408 -0
- package/dist/xanoscript_docs_auto/operators.md +368 -0
- package/dist/xanoscript_docs_auto/syntax.md +287 -0
- package/dist/xanoscript_docs_auto/tables.md +447 -0
- package/dist/xanoscript_docs_auto/tasks.md +479 -0
- package/dist/xanoscript_docs_auto/testing.md +574 -0
- package/dist/xanoscript_docs_auto/tools.md +485 -0
- package/dist/xanoscript_docs_auto/triggers.md +595 -0
- package/dist/xanoscript_docs_auto/types.md +323 -0
- package/dist/xanoscript_docs_auto/variables.md +462 -0
- package/dist/xanoscript_docs_auto/version.json +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export const tableDoc = {
|
|
2
|
+
topic: "table",
|
|
3
|
+
title: "Database Table Management",
|
|
4
|
+
description: `Tables are the database layer in Xano. Each table has a schema (fields), indexes, and optional triggers.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
- Tables store structured data with typed fields
|
|
8
|
+
- Schemas define field types, validation, and defaults
|
|
9
|
+
- Indexes improve query performance
|
|
10
|
+
- Triggers run automatically on data changes
|
|
11
|
+
- Tables can reference other tables (foreign keys)
|
|
12
|
+
|
|
13
|
+
## Field Types
|
|
14
|
+
- **Primitives:** int, text, bool, decimal, email, password
|
|
15
|
+
- **Temporal:** timestamp, date
|
|
16
|
+
- **Structured:** json, object
|
|
17
|
+
- **Files:** blob (with subtypes: image, video, audio, attachment)
|
|
18
|
+
- **References:** tableref, tablerefuuid (foreign keys)
|
|
19
|
+
- **Special:** enum, vector, geo_* (point, polygon, etc.)`,
|
|
20
|
+
ai_hints: `- Always check existing schema before adding fields
|
|
21
|
+
- Use \`tableref\` type for foreign keys to other tables
|
|
22
|
+
- Consider indexes for frequently queried fields
|
|
23
|
+
- Triggers run automatically - be careful with side effects
|
|
24
|
+
- Use \`include_xanoscript=true\` to see full table definition`,
|
|
25
|
+
endpoints: [
|
|
26
|
+
{
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: "/workspace/{workspace_id}/table",
|
|
29
|
+
tool_name: "listTables",
|
|
30
|
+
description: "List all database tables in a workspace.",
|
|
31
|
+
parameters: [
|
|
32
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
33
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
34
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page" },
|
|
35
|
+
{ name: "search", type: "string", description: "Search by table name" },
|
|
36
|
+
{ name: "sort", type: "string", enum: ["id", "name", "created_at"], default: "created_at", description: "Sort field" },
|
|
37
|
+
{ name: "order", type: "string", enum: ["asc", "desc"], default: "desc", description: "Sort direction" },
|
|
38
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript schema definition" },
|
|
39
|
+
{ name: "branch", type: "string", description: "Filter by branch name" }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
method: "GET",
|
|
44
|
+
path: "/workspace/{workspace_id}/table/{table_id}",
|
|
45
|
+
tool_name: "getTable",
|
|
46
|
+
description: "Get details of a specific table including schema.",
|
|
47
|
+
parameters: [
|
|
48
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
49
|
+
{ name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" },
|
|
50
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript definition" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
method: "POST",
|
|
55
|
+
path: "/workspace/{workspace_id}/table",
|
|
56
|
+
tool_name: "createTable",
|
|
57
|
+
description: "Create a new database table with optional schema.",
|
|
58
|
+
parameters: [
|
|
59
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
60
|
+
],
|
|
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
|
+
}
|
|
68
|
+
},
|
|
69
|
+
example: {
|
|
70
|
+
method: "POST",
|
|
71
|
+
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]
|
|
79
|
+
}`
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
method: "PUT",
|
|
85
|
+
path: "/workspace/{workspace_id}/table/{table_id}",
|
|
86
|
+
tool_name: "updateTable",
|
|
87
|
+
description: "Update table definition and schema.",
|
|
88
|
+
parameters: [
|
|
89
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
90
|
+
{ name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" }
|
|
91
|
+
],
|
|
92
|
+
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
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
method: "DELETE",
|
|
103
|
+
path: "/workspace/{workspace_id}/table/{table_id}",
|
|
104
|
+
tool_name: "deleteTable",
|
|
105
|
+
description: "Delete a table and all its data. This action is irreversible.",
|
|
106
|
+
parameters: [
|
|
107
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
108
|
+
{ name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" }
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
method: "POST",
|
|
113
|
+
path: "/workspace/{workspace_id}/table/{table_id}/schema",
|
|
114
|
+
tool_name: "addTableField",
|
|
115
|
+
description: "Add a new field to the table schema.",
|
|
116
|
+
parameters: [
|
|
117
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
118
|
+
{ name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" }
|
|
119
|
+
],
|
|
120
|
+
request_body: {
|
|
121
|
+
type: "application/json",
|
|
122
|
+
properties: {
|
|
123
|
+
name: { type: "string", description: "Field name", required: true },
|
|
124
|
+
type: { type: "string", description: "Field type (int, text, bool, etc.)", required: true },
|
|
125
|
+
nullable: { type: "boolean", description: "Allow null values" },
|
|
126
|
+
default: { type: "any", description: "Default value" }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
method: "POST",
|
|
132
|
+
path: "/workspace/{workspace_id}/table/{table_id}/index",
|
|
133
|
+
tool_name: "createTableIndex",
|
|
134
|
+
description: "Create an index on table fields for query performance.",
|
|
135
|
+
parameters: [
|
|
136
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
137
|
+
{ name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" }
|
|
138
|
+
],
|
|
139
|
+
request_body: {
|
|
140
|
+
type: "application/json",
|
|
141
|
+
properties: {
|
|
142
|
+
name: { type: "string", description: "Index name", required: true },
|
|
143
|
+
type: { type: "string", description: "Index type: primary, unique, btree, search, spatial, vector", required: true },
|
|
144
|
+
fields: { type: "array", description: "Fields to index", required: true }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
method: "GET",
|
|
150
|
+
path: "/workspace/{workspace_id}/table/{table_id}/content",
|
|
151
|
+
tool_name: "getTableContent",
|
|
152
|
+
description: "Get table content/data (paginated).",
|
|
153
|
+
parameters: [
|
|
154
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
155
|
+
{ name: "table_id", type: "integer", required: true, in: "path", description: "Table ID" },
|
|
156
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
157
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page" }
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
schemas: {
|
|
162
|
+
Table: {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
id: { type: "integer" },
|
|
166
|
+
name: { type: "string" },
|
|
167
|
+
description: { type: "string" },
|
|
168
|
+
schema: {
|
|
169
|
+
type: "array",
|
|
170
|
+
items: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
name: { type: "string" },
|
|
174
|
+
type: { type: "string" },
|
|
175
|
+
nullable: { type: "boolean" },
|
|
176
|
+
default: { type: "any" }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
indexes: { type: "array" },
|
|
181
|
+
created_at: { type: "string", format: "date-time" },
|
|
182
|
+
updated_at: { type: "string", format: "date-time" }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
FieldTypes: {
|
|
186
|
+
primitives: ["int", "text", "bool", "decimal", "email", "password"],
|
|
187
|
+
temporal: ["timestamp", "date"],
|
|
188
|
+
structured: ["json", "object"],
|
|
189
|
+
files: ["blob", "image", "video", "audio", "attachment"],
|
|
190
|
+
references: ["tableref", "tablerefuuid"],
|
|
191
|
+
special: ["enum", "vector", "geo_point", "geo_polygon", "geo_linestring"]
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
related_topics: ["function", "api", "workflows"]
|
|
195
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export const taskDoc = {
|
|
2
|
+
topic: "task",
|
|
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.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
- Tasks run on a schedule (cron syntax)
|
|
8
|
+
- No HTTP trigger - runs automatically
|
|
9
|
+
- Can access databases, call functions, make external requests
|
|
10
|
+
- Support draft/publish workflow
|
|
11
|
+
- Restricted to paid accounts
|
|
12
|
+
|
|
13
|
+
## Common Use Cases
|
|
14
|
+
- Data cleanup and archiving
|
|
15
|
+
- Report generation
|
|
16
|
+
- External API sync
|
|
17
|
+
- Notification sending
|
|
18
|
+
- Cache warming`,
|
|
19
|
+
ai_hints: `- Tasks require paid account (will fail on free tier)
|
|
20
|
+
- Use cron syntax for scheduling (e.g., "0 * * * *" for hourly)
|
|
21
|
+
- Tasks have no HTTP inputs - all data comes from database or environment
|
|
22
|
+
- Draft changes won't affect running schedule until published
|
|
23
|
+
- Check task history to debug execution issues`,
|
|
24
|
+
endpoints: [
|
|
25
|
+
{
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: "/workspace/{workspace_id}/task",
|
|
28
|
+
tool_name: "listTasks",
|
|
29
|
+
description: "List all scheduled tasks in a workspace.",
|
|
30
|
+
parameters: [
|
|
31
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
32
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
33
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page" },
|
|
34
|
+
{ name: "search", type: "string", description: "Search by task name" },
|
|
35
|
+
{ name: "sort", type: "string", enum: ["id", "name", "created_at"], default: "created_at", description: "Sort field" },
|
|
36
|
+
{ name: "order", type: "string", enum: ["asc", "desc"], default: "desc", description: "Sort direction" },
|
|
37
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript code" },
|
|
38
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft versions" },
|
|
39
|
+
{ name: "branch", type: "string", description: "Filter by branch name" }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
method: "GET",
|
|
44
|
+
path: "/workspace/{workspace_id}/task/{task_id}",
|
|
45
|
+
tool_name: "getTask",
|
|
46
|
+
description: "Get details of a specific scheduled task.",
|
|
47
|
+
parameters: [
|
|
48
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
49
|
+
{ name: "task_id", type: "integer", required: true, in: "path", description: "Task ID" },
|
|
50
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript code" },
|
|
51
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft version" }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
method: "POST",
|
|
56
|
+
path: "/workspace/{workspace_id}/task",
|
|
57
|
+
tool_name: "createTask",
|
|
58
|
+
description: "Create a new scheduled task. Requires paid account.",
|
|
59
|
+
parameters: [
|
|
60
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
61
|
+
],
|
|
62
|
+
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
|
+
}
|
|
71
|
+
},
|
|
72
|
+
example: {
|
|
73
|
+
method: "POST",
|
|
74
|
+
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 {
|
|
81
|
+
stack {
|
|
82
|
+
var $cutoff {
|
|
83
|
+
value = now() - 30.days
|
|
84
|
+
}
|
|
85
|
+
db.sessions.query()
|
|
86
|
+
.where("created_at", "<", $cutoff)
|
|
87
|
+
.delete()
|
|
88
|
+
}
|
|
89
|
+
}`
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
method: "PUT",
|
|
95
|
+
path: "/workspace/{workspace_id}/task/{task_id}",
|
|
96
|
+
tool_name: "updateTask",
|
|
97
|
+
description: "Update an existing scheduled task.",
|
|
98
|
+
parameters: [
|
|
99
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
100
|
+
{ name: "task_id", type: "integer", required: true, in: "path", description: "Task ID" },
|
|
101
|
+
{ name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
|
|
102
|
+
],
|
|
103
|
+
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
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
method: "DELETE",
|
|
116
|
+
path: "/workspace/{workspace_id}/task/{task_id}",
|
|
117
|
+
tool_name: "deleteTask",
|
|
118
|
+
description: "Delete a scheduled task.",
|
|
119
|
+
parameters: [
|
|
120
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
121
|
+
{ name: "task_id", type: "integer", required: true, in: "path", description: "Task ID" }
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
method: "PUT",
|
|
126
|
+
path: "/workspace/{workspace_id}/task/{task_id}/security",
|
|
127
|
+
tool_name: "updateTaskSecurity",
|
|
128
|
+
description: "Update security settings for the task.",
|
|
129
|
+
parameters: [
|
|
130
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
131
|
+
{ name: "task_id", type: "integer", required: true, in: "path", description: "Task ID" }
|
|
132
|
+
],
|
|
133
|
+
request_body: {
|
|
134
|
+
type: "application/json",
|
|
135
|
+
properties: {
|
|
136
|
+
guid: { type: "string", description: "Security group GUID" }
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
schemas: {
|
|
142
|
+
Task: {
|
|
143
|
+
type: "object",
|
|
144
|
+
properties: {
|
|
145
|
+
id: { type: "integer" },
|
|
146
|
+
name: { type: "string" },
|
|
147
|
+
description: { type: "string" },
|
|
148
|
+
schedule: { type: "string", description: "Cron expression" },
|
|
149
|
+
active: { type: "boolean" },
|
|
150
|
+
xanoscript: { type: "string" },
|
|
151
|
+
created_at: { type: "string", format: "date-time" },
|
|
152
|
+
updated_at: { type: "string", format: "date-time" }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
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 * *"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
related_topics: ["function", "history"]
|
|
165
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
export const toolDoc = {
|
|
2
|
+
topic: "tool",
|
|
3
|
+
title: "Agent Tool Management",
|
|
4
|
+
description: `Tools are callable functions that AI agents can use to perform actions. They define inputs, outputs, and the logic to execute.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
- Tools are used by agents to interact with data and external systems
|
|
8
|
+
- Each tool has defined inputs and outputs
|
|
9
|
+
- Tools contain XanoScript logic
|
|
10
|
+
- Can be shared across multiple agents
|
|
11
|
+
- Support draft/publish workflow
|
|
12
|
+
|
|
13
|
+
## Tool Design Best Practices
|
|
14
|
+
- Clear, descriptive names (e.g., "lookup_customer", "send_email")
|
|
15
|
+
- Well-defined input schemas
|
|
16
|
+
- Specific, focused functionality
|
|
17
|
+
- Good error handling`,
|
|
18
|
+
ai_hints: `- Create tools before creating agents that use them
|
|
19
|
+
- Tool names should be descriptive verbs (lookup, create, update, send)
|
|
20
|
+
- Keep tools focused on single responsibilities
|
|
21
|
+
- Use \`include_xanoscript=true\` to see tool implementation
|
|
22
|
+
- Tools can call other functions for code reuse`,
|
|
23
|
+
endpoints: [
|
|
24
|
+
{
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: "/workspace/{workspace_id}/tool",
|
|
27
|
+
tool_name: "listTools",
|
|
28
|
+
description: "List all tools in a workspace.",
|
|
29
|
+
parameters: [
|
|
30
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
31
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
32
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page" },
|
|
33
|
+
{ name: "search", type: "string", description: "Search by tool name" },
|
|
34
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript code" },
|
|
35
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft versions" }
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
method: "GET",
|
|
40
|
+
path: "/workspace/{workspace_id}/tool/{tool_id}",
|
|
41
|
+
tool_name: "getTool",
|
|
42
|
+
description: "Get details of a specific tool.",
|
|
43
|
+
parameters: [
|
|
44
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
45
|
+
{ name: "tool_id", type: "integer", required: true, in: "path", description: "Tool ID" },
|
|
46
|
+
{ name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript code" },
|
|
47
|
+
{ name: "include_draft", type: "boolean", default: false, description: "Include draft version" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
method: "POST",
|
|
52
|
+
path: "/workspace/{workspace_id}/tool",
|
|
53
|
+
tool_name: "createTool",
|
|
54
|
+
description: "Create a new tool for agents to use.",
|
|
55
|
+
parameters: [
|
|
56
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
57
|
+
],
|
|
58
|
+
request_body: {
|
|
59
|
+
type: "application/json",
|
|
60
|
+
properties: {
|
|
61
|
+
name: { type: "string", description: "Tool name", required: true },
|
|
62
|
+
description: { type: "string", description: "Tool description (shown to AI)" },
|
|
63
|
+
xanoscript: { type: "string", description: "XanoScript tool definition", required: true }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
example: {
|
|
67
|
+
method: "POST",
|
|
68
|
+
path: "/workspace/1/tool",
|
|
69
|
+
body: {
|
|
70
|
+
name: "lookup_order",
|
|
71
|
+
description: "Look up an order by order ID or customer email",
|
|
72
|
+
xanoscript: `tool lookup_order {
|
|
73
|
+
input {
|
|
74
|
+
int order_id?
|
|
75
|
+
text email?
|
|
76
|
+
}
|
|
77
|
+
stack {
|
|
78
|
+
var $order {
|
|
79
|
+
value = db.orders.query()
|
|
80
|
+
.where("id", "=", $input.order_id)
|
|
81
|
+
.or("customer_email", "=", $input.email)
|
|
82
|
+
.first()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
response = $order
|
|
86
|
+
}`
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
method: "PUT",
|
|
92
|
+
path: "/workspace/{workspace_id}/tool/{tool_id}",
|
|
93
|
+
tool_name: "updateTool",
|
|
94
|
+
description: "Update an existing tool.",
|
|
95
|
+
parameters: [
|
|
96
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
97
|
+
{ name: "tool_id", type: "integer", required: true, in: "path", description: "Tool ID" },
|
|
98
|
+
{ name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
|
|
99
|
+
],
|
|
100
|
+
request_body: {
|
|
101
|
+
type: "application/json",
|
|
102
|
+
properties: {
|
|
103
|
+
name: { type: "string", description: "Tool name" },
|
|
104
|
+
description: { type: "string", description: "Tool description" },
|
|
105
|
+
xanoscript: { type: "string", description: "XanoScript tool definition" }
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
method: "DELETE",
|
|
111
|
+
path: "/workspace/{workspace_id}/tool/{tool_id}",
|
|
112
|
+
tool_name: "deleteTool",
|
|
113
|
+
description: "Delete a tool. Ensure no agents depend on it.",
|
|
114
|
+
parameters: [
|
|
115
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
116
|
+
{ name: "tool_id", type: "integer", required: true, in: "path", description: "Tool ID" }
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
method: "PUT",
|
|
121
|
+
path: "/workspace/{workspace_id}/tool/{tool_id}/security",
|
|
122
|
+
tool_name: "updateToolSecurity",
|
|
123
|
+
description: "Update security settings for the tool.",
|
|
124
|
+
parameters: [
|
|
125
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
126
|
+
{ name: "tool_id", type: "integer", required: true, in: "path", description: "Tool ID" }
|
|
127
|
+
],
|
|
128
|
+
request_body: {
|
|
129
|
+
type: "application/json",
|
|
130
|
+
properties: {
|
|
131
|
+
guid: { type: "string", description: "Security group GUID" }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
schemas: {
|
|
137
|
+
Tool: {
|
|
138
|
+
type: "object",
|
|
139
|
+
properties: {
|
|
140
|
+
id: { type: "integer" },
|
|
141
|
+
name: { type: "string" },
|
|
142
|
+
description: { type: "string" },
|
|
143
|
+
xanoscript: { type: "string" },
|
|
144
|
+
created_at: { type: "string", format: "date-time" },
|
|
145
|
+
updated_at: { type: "string", format: "date-time" }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
related_topics: ["agent", "mcp_server", "function"]
|
|
150
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export const workflowsDoc = {
|
|
2
|
+
topic: "workflows",
|
|
3
|
+
title: "Common Workflows",
|
|
4
|
+
description: `Step-by-step guides for common multi-step tasks using the Xano Meta API.
|
|
5
|
+
|
|
6
|
+
## Quick Reference
|
|
7
|
+
- **Create API Endpoint**: workspace → apigroup → api
|
|
8
|
+
- **Create Database Table**: workspace → table → schema → index
|
|
9
|
+
- **Set Up AI Agent**: tool → agent → (optional) mcp_server
|
|
10
|
+
- **Deploy Changes**: draft → test → publish`,
|
|
11
|
+
ai_hints: `- Always start by listing existing resources
|
|
12
|
+
- Use workspace context to understand current state
|
|
13
|
+
- Create dependencies first (tables before APIs, tools before agents)
|
|
14
|
+
- Test in development branch before production
|
|
15
|
+
- Export backup before major changes`,
|
|
16
|
+
patterns: [
|
|
17
|
+
{
|
|
18
|
+
name: "Create a Complete REST API",
|
|
19
|
+
description: "Set up a table with CRUD endpoints",
|
|
20
|
+
steps: [
|
|
21
|
+
"1. `GET /workspace` - Find your workspace ID",
|
|
22
|
+
"2. `POST /workspace/{id}/table` - Create the database table",
|
|
23
|
+
"3. `POST /workspace/{id}/table/{id}/schema` - Add fields to the table",
|
|
24
|
+
"4. `POST /workspace/{id}/table/{id}/index` - Add indexes for query performance",
|
|
25
|
+
"5. `GET /workspace/{id}/apigroup` - Find or create an API group",
|
|
26
|
+
"6. `POST /workspace/{id}/apigroup/{id}/api` - Create GET (list) endpoint",
|
|
27
|
+
"7. `POST /workspace/{id}/apigroup/{id}/api` - Create GET (single) endpoint",
|
|
28
|
+
"8. `POST /workspace/{id}/apigroup/{id}/api` - Create POST endpoint",
|
|
29
|
+
"9. `POST /workspace/{id}/apigroup/{id}/api` - Create PUT endpoint",
|
|
30
|
+
"10. `POST /workspace/{id}/apigroup/{id}/api` - Create DELETE endpoint"
|
|
31
|
+
],
|
|
32
|
+
example: `// Example: Create users table and list endpoint
|
|
33
|
+
|
|
34
|
+
// 1. Create table
|
|
35
|
+
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}"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 2. Create list endpoint
|
|
42
|
+
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}"
|
|
48
|
+
}`
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "Set Up an AI Agent with Tools",
|
|
52
|
+
description: "Create tools and an agent that uses them",
|
|
53
|
+
steps: [
|
|
54
|
+
"1. `GET /workspace` - Find your workspace ID",
|
|
55
|
+
"2. `POST /workspace/{id}/tool` - Create first tool",
|
|
56
|
+
"3. `POST /workspace/{id}/tool` - Create additional tools as needed",
|
|
57
|
+
"4. `POST /workspace/{id}/agent` - Create agent with tool references",
|
|
58
|
+
"5. `POST /workspace/{id}/mcp_server` (optional) - Expose via MCP"
|
|
59
|
+
],
|
|
60
|
+
example: `// 1. Create a lookup tool
|
|
61
|
+
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}"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 2. Create agent
|
|
69
|
+
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}"
|
|
73
|
+
}`
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "Deploy Function Changes Safely",
|
|
77
|
+
description: "Use draft/publish workflow for safe deployments",
|
|
78
|
+
steps: [
|
|
79
|
+
"1. `GET /workspace/{id}/function/{id}?include_xanoscript=true` - Get current function",
|
|
80
|
+
"2. `PUT /workspace/{id}/function/{id}?publish=false` - Save changes as draft",
|
|
81
|
+
"3. Test the draft version in development",
|
|
82
|
+
"4. `PUT /workspace/{id}/function/{id}?publish=true` - Publish to production"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "Create a Scheduled Data Cleanup Task",
|
|
87
|
+
description: "Set up automated data maintenance",
|
|
88
|
+
steps: [
|
|
89
|
+
"1. `GET /workspace` - Find workspace ID",
|
|
90
|
+
"2. `POST /workspace/{id}/task` - Create the task with schedule",
|
|
91
|
+
"3. Monitor via `GET /workspace/{id}/task_history`"
|
|
92
|
+
],
|
|
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 db.sessions.query().where('created_at', '<', now() - 30.days).delete()\\n }\\n}"
|
|
99
|
+
}`
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "Export and Import Workspace",
|
|
103
|
+
description: "Backup or migrate workspace data",
|
|
104
|
+
steps: [
|
|
105
|
+
"1. `POST /workspace/{id}/export` - Export complete workspace",
|
|
106
|
+
"2. Download the export file",
|
|
107
|
+
"3. `POST /workspace/{target_id}/import` - Import to target workspace"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "Add Authentication to API Group",
|
|
112
|
+
description: "Secure API endpoints with authentication",
|
|
113
|
+
steps: [
|
|
114
|
+
"1. `GET /workspace/{id}/apigroup/{id}` - Get API group details",
|
|
115
|
+
"2. `PUT /workspace/{id}/apigroup/{id}/security` - Set security GUID",
|
|
116
|
+
"3. Individual endpoints inherit group security unless overridden"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "Debug a Failing API Endpoint",
|
|
121
|
+
description: "Use history to troubleshoot issues",
|
|
122
|
+
steps: [
|
|
123
|
+
"1. `POST /workspace/{id}/request_history/search` - Search for failed requests",
|
|
124
|
+
"2. Filter by status: [400, 401, 403, 404, 500]",
|
|
125
|
+
"3. Use include_payload=true to see request/response details",
|
|
126
|
+
"4. `GET /workspace/{id}/apigroup/{id}/api/{id}?include_xanoscript=true` - Review endpoint code"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
related_topics: ["start", "api", "table", "function", "agent"]
|
|
131
|
+
};
|