@xano/developer-mcp 1.0.13 → 1.0.15
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 +8 -8
- package/dist/api_docs/format.js +5 -2
- package/dist/index.js +44 -5
- package/dist/meta_api_docs/format.d.ts +5 -0
- package/dist/meta_api_docs/format.js +171 -0
- package/dist/meta_api_docs/index.d.ts +52 -0
- package/dist/meta_api_docs/index.js +111 -0
- package/dist/meta_api_docs/topics/agent.d.ts +2 -0
- package/dist/meta_api_docs/topics/agent.js +142 -0
- package/dist/meta_api_docs/topics/api.d.ts +2 -0
- package/dist/meta_api_docs/topics/api.js +176 -0
- package/dist/meta_api_docs/topics/apigroup.d.ts +2 -0
- package/dist/meta_api_docs/topics/apigroup.js +124 -0
- package/dist/meta_api_docs/topics/authentication.d.ts +2 -0
- package/dist/meta_api_docs/topics/authentication.js +61 -0
- package/dist/meta_api_docs/topics/branch.d.ts +2 -0
- package/dist/meta_api_docs/topics/branch.js +73 -0
- package/dist/meta_api_docs/topics/file.d.ts +2 -0
- package/dist/meta_api_docs/topics/file.js +70 -0
- package/dist/meta_api_docs/topics/function.d.ts +2 -0
- package/dist/meta_api_docs/topics/function.js +164 -0
- package/dist/meta_api_docs/topics/history.d.ts +2 -0
- package/dist/meta_api_docs/topics/history.js +149 -0
- package/dist/meta_api_docs/topics/mcp_server.d.ts +2 -0
- package/dist/meta_api_docs/topics/mcp_server.js +139 -0
- package/dist/meta_api_docs/topics/middleware.d.ts +2 -0
- package/dist/meta_api_docs/topics/middleware.js +156 -0
- package/dist/meta_api_docs/topics/realtime.d.ts +2 -0
- package/dist/meta_api_docs/topics/realtime.js +112 -0
- package/dist/meta_api_docs/topics/start.d.ts +2 -0
- package/dist/meta_api_docs/topics/start.js +107 -0
- package/dist/meta_api_docs/topics/table.d.ts +2 -0
- package/dist/meta_api_docs/topics/table.js +195 -0
- package/dist/meta_api_docs/topics/task.d.ts +2 -0
- package/dist/meta_api_docs/topics/task.js +165 -0
- package/dist/meta_api_docs/topics/tool.d.ts +2 -0
- package/dist/meta_api_docs/topics/tool.js +150 -0
- package/dist/meta_api_docs/topics/workflows.d.ts +2 -0
- package/dist/meta_api_docs/topics/workflows.js +131 -0
- package/dist/meta_api_docs/topics/workspace.d.ts +2 -0
- package/dist/meta_api_docs/topics/workspace.js +153 -0
- package/dist/meta_api_docs/types.d.ts +79 -0
- package/dist/meta_api_docs/types.js +4 -0
- package/dist/run_api_docs/format.d.ts +5 -0
- package/dist/run_api_docs/format.js +175 -0
- package/dist/run_api_docs/index.d.ts +52 -0
- package/dist/run_api_docs/index.js +90 -0
- package/dist/run_api_docs/topics/data.d.ts +2 -0
- package/dist/run_api_docs/topics/data.js +104 -0
- package/dist/run_api_docs/topics/history.d.ts +2 -0
- package/dist/run_api_docs/topics/history.js +93 -0
- package/dist/run_api_docs/topics/run.d.ts +2 -0
- package/dist/run_api_docs/topics/run.js +110 -0
- package/dist/run_api_docs/topics/session.d.ts +2 -0
- package/dist/run_api_docs/topics/session.js +166 -0
- package/dist/run_api_docs/topics/start.d.ts +2 -0
- package/dist/run_api_docs/topics/start.js +97 -0
- package/dist/run_api_docs/topics/workflows.d.ts +2 -0
- package/dist/run_api_docs/topics/workflows.js +140 -0
- package/package.json +1 -1
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export const workspaceDoc = {
|
|
2
|
+
topic: "workspace",
|
|
3
|
+
title: "Workspace Management",
|
|
4
|
+
description: `Workspaces are the top-level container for all Xano resources. Each workspace contains databases, APIs, functions, tasks, agents, and more.
|
|
5
|
+
|
|
6
|
+
## Key Operations
|
|
7
|
+
- List/get workspaces
|
|
8
|
+
- Export/import workspace data
|
|
9
|
+
- Generate workspace context for AI
|
|
10
|
+
- Get OpenAPI specifications
|
|
11
|
+
- Convert between XanoScript and JSON`,
|
|
12
|
+
ai_hints: `- Use \`getWorkspaceContext\` first to understand workspace structure
|
|
13
|
+
- Export before making major changes (backup)
|
|
14
|
+
- Check branch before modifying (prod vs dev)
|
|
15
|
+
- \`export-schema\` is lighter than \`export\` (schema only vs full data)
|
|
16
|
+
- OpenAPI spec useful for understanding available endpoints`,
|
|
17
|
+
endpoints: [
|
|
18
|
+
{
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/workspace",
|
|
21
|
+
tool_name: "listWorkspaces",
|
|
22
|
+
description: "List all accessible workspaces with pagination and filtering.",
|
|
23
|
+
parameters: [
|
|
24
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
25
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page (max 10000)" },
|
|
26
|
+
{ name: "search", type: "string", description: "Search by workspace name" },
|
|
27
|
+
{ name: "sort", type: "string", enum: ["id", "name", "created_at"], default: "created_at", description: "Sort field" },
|
|
28
|
+
{ name: "order", type: "string", enum: ["asc", "desc"], default: "desc", description: "Sort direction" }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
method: "GET",
|
|
33
|
+
path: "/workspace/{workspace_id}",
|
|
34
|
+
tool_name: "getWorkspace",
|
|
35
|
+
description: "Get details of a specific workspace.",
|
|
36
|
+
parameters: [
|
|
37
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
method: "POST",
|
|
42
|
+
path: "/workspace/{workspace_id}/export-schema",
|
|
43
|
+
tool_name: "exportWorkspaceSchema",
|
|
44
|
+
description: "Export database schemas and branch configuration only (lighter than full export).",
|
|
45
|
+
parameters: [
|
|
46
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
47
|
+
{ name: "password", type: "string", description: "Optional encryption password" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
method: "POST",
|
|
52
|
+
path: "/workspace/{workspace_id}/export",
|
|
53
|
+
tool_name: "exportWorkspace",
|
|
54
|
+
description: "Export complete workspace data and configuration including APIs, functions, data.",
|
|
55
|
+
parameters: [
|
|
56
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
57
|
+
{ name: "password", type: "string", description: "Optional encryption password" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: "/workspace/{workspace_id}/import",
|
|
63
|
+
tool_name: "importWorkspace",
|
|
64
|
+
description: "Import and restore workspace content from an export file.",
|
|
65
|
+
parameters: [
|
|
66
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
67
|
+
],
|
|
68
|
+
request_body: {
|
|
69
|
+
type: "multipart/form-data",
|
|
70
|
+
properties: {
|
|
71
|
+
file: { type: "file", description: "Export file to import", required: true },
|
|
72
|
+
password: { type: "string", description: "Decryption password if encrypted" }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
method: "POST",
|
|
78
|
+
path: "/workspace/{workspace_id}/import-schema",
|
|
79
|
+
tool_name: "importWorkspaceSchema",
|
|
80
|
+
description: "Import database schema into a new branch.",
|
|
81
|
+
parameters: [
|
|
82
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
83
|
+
],
|
|
84
|
+
request_body: {
|
|
85
|
+
type: "multipart/form-data",
|
|
86
|
+
properties: {
|
|
87
|
+
file: { type: "file", description: "Schema export file", required: true },
|
|
88
|
+
password: { type: "string", description: "Decryption password if encrypted" }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
method: "GET",
|
|
94
|
+
path: "/workspace/{workspace_id}/openapi",
|
|
95
|
+
tool_name: "getWorkspaceOpenAPI",
|
|
96
|
+
description: "Get OpenAPI v3 specification for all APIs in the workspace.",
|
|
97
|
+
parameters: [
|
|
98
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
method: "GET",
|
|
103
|
+
path: "/workspace/{workspace_id}/context",
|
|
104
|
+
tool_name: "getWorkspaceContext",
|
|
105
|
+
description: "Generate complete workspace context map for AI agents. Essential for understanding workspace structure.",
|
|
106
|
+
parameters: [
|
|
107
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
108
|
+
{ name: "format", type: "string", enum: ["json", "yaml"], default: "json", description: "Output format" },
|
|
109
|
+
{ name: "user_descriptions", type: "boolean", default: false, description: "Include user-provided descriptions" },
|
|
110
|
+
{ name: "ai_descriptions", type: "boolean", default: false, description: "Include AI-generated descriptions" }
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
method: "POST",
|
|
115
|
+
path: "/workspace/{workspace_id}/convert/fromXS",
|
|
116
|
+
tool_name: "convertFromXanoScript",
|
|
117
|
+
description: "Convert XanoScript code to JSON format for programmatic manipulation.",
|
|
118
|
+
parameters: [
|
|
119
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
120
|
+
],
|
|
121
|
+
request_body: {
|
|
122
|
+
type: "text/x-xanoscript",
|
|
123
|
+
description: "XanoScript code to convert"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
method: "POST",
|
|
128
|
+
path: "/workspace/{workspace_id}/convert/toXS",
|
|
129
|
+
tool_name: "convertToXanoScript",
|
|
130
|
+
description: "Convert JSON to XanoScript format for human-readable code.",
|
|
131
|
+
parameters: [
|
|
132
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
133
|
+
],
|
|
134
|
+
request_body: {
|
|
135
|
+
type: "application/json",
|
|
136
|
+
description: "JSON structure to convert to XanoScript"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
schemas: {
|
|
141
|
+
Workspace: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
id: { type: "integer", description: "Unique workspace ID" },
|
|
145
|
+
name: { type: "string", description: "Workspace name" },
|
|
146
|
+
description: { type: "string", description: "Workspace description" },
|
|
147
|
+
created_at: { type: "string", format: "date-time" },
|
|
148
|
+
updated_at: { type: "string", format: "date-time" }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
related_topics: ["apigroup", "table", "function", "branch"]
|
|
153
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Xano Meta API documentation
|
|
3
|
+
*/
|
|
4
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
5
|
+
export interface ParameterDoc {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
default?: unknown;
|
|
10
|
+
description: string;
|
|
11
|
+
enum?: string[];
|
|
12
|
+
in?: "path" | "query" | "header";
|
|
13
|
+
}
|
|
14
|
+
export interface RequestBodyDoc {
|
|
15
|
+
type: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
properties?: Record<string, {
|
|
18
|
+
type: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
example?: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface ResponseDoc {
|
|
25
|
+
type: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
properties?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface RequestExampleDoc {
|
|
30
|
+
method: string;
|
|
31
|
+
path: string;
|
|
32
|
+
headers?: Record<string, string>;
|
|
33
|
+
body?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface EndpointDoc {
|
|
36
|
+
method: HttpMethod;
|
|
37
|
+
path: string;
|
|
38
|
+
tool_name?: string;
|
|
39
|
+
description: string;
|
|
40
|
+
tags?: string[];
|
|
41
|
+
parameters?: ParameterDoc[];
|
|
42
|
+
request_body?: RequestBodyDoc;
|
|
43
|
+
response?: ResponseDoc;
|
|
44
|
+
example?: RequestExampleDoc;
|
|
45
|
+
}
|
|
46
|
+
export interface ExampleDoc {
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
request: {
|
|
50
|
+
method: string;
|
|
51
|
+
path: string;
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
body?: unknown;
|
|
54
|
+
};
|
|
55
|
+
response?: unknown;
|
|
56
|
+
}
|
|
57
|
+
export interface PatternDoc {
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
steps: string[];
|
|
61
|
+
example?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface TopicDoc {
|
|
64
|
+
topic: string;
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
endpoints?: EndpointDoc[];
|
|
68
|
+
examples?: ExampleDoc[];
|
|
69
|
+
related_topics?: string[];
|
|
70
|
+
schemas?: Record<string, unknown>;
|
|
71
|
+
patterns?: PatternDoc[];
|
|
72
|
+
ai_hints?: string;
|
|
73
|
+
}
|
|
74
|
+
export type DetailLevel = "overview" | "detailed" | "examples";
|
|
75
|
+
export interface MetaApiDocsArgs {
|
|
76
|
+
topic: string;
|
|
77
|
+
detail_level?: DetailLevel;
|
|
78
|
+
include_schemas?: boolean;
|
|
79
|
+
}
|