@xano/developer-mcp 1.0.0
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/LICENSE +21 -0
- package/README.md +261 -0
- package/api_docs/addon.md +193 -0
- package/api_docs/agent.md +154 -0
- package/api_docs/api_group.md +236 -0
- package/api_docs/authentication.md +68 -0
- package/api_docs/file.md +190 -0
- package/api_docs/function.md +217 -0
- package/api_docs/history.md +263 -0
- package/api_docs/index.md +104 -0
- package/api_docs/mcp_server.md +139 -0
- package/api_docs/middleware.md +205 -0
- package/api_docs/realtime.md +153 -0
- package/api_docs/table.md +151 -0
- package/api_docs/task.md +191 -0
- package/api_docs/tool.md +216 -0
- package/api_docs/triggers.md +344 -0
- package/api_docs/workspace.md +246 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +495 -0
- package/package.json +49 -0
- package/xanoscript_docs/README.md +1 -0
- package/xanoscript_docs/api_query_examples.md +1255 -0
- package/xanoscript_docs/api_query_guideline.md +129 -0
- package/xanoscript_docs/build_from_lovable.md +715 -0
- package/xanoscript_docs/db_query_guideline.md +427 -0
- package/xanoscript_docs/ephemeral_environment_guideline.md +529 -0
- package/xanoscript_docs/expression_guideline.md +1086 -0
- package/xanoscript_docs/frontend_guideline.md +67 -0
- package/xanoscript_docs/function_examples.md +1406 -0
- package/xanoscript_docs/function_guideline.md +130 -0
- package/xanoscript_docs/functions.md +2155 -0
- package/xanoscript_docs/input_guideline.md +227 -0
- package/xanoscript_docs/mcp_server_examples.md +36 -0
- package/xanoscript_docs/mcp_server_guideline.md +69 -0
- package/xanoscript_docs/query_filter.md +489 -0
- package/xanoscript_docs/table_examples.md +586 -0
- package/xanoscript_docs/table_guideline.md +137 -0
- package/xanoscript_docs/task_examples.md +511 -0
- package/xanoscript_docs/task_guideline.md +103 -0
- package/xanoscript_docs/tips_and_tricks.md +144 -0
- package/xanoscript_docs/tool_examples.md +69 -0
- package/xanoscript_docs/tool_guideline.md +139 -0
- package/xanoscript_docs/unit_testing_guideline.md +328 -0
- package/xanoscript_docs/version.json +3 -0
- package/xanoscript_docs/workspace.md +17 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Xano, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Xano Developer MCP
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that provides AI assistants with comprehensive documentation and tools for developing applications on the Xano Headless API platform.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This MCP server acts as a bridge between AI models and Xano's developer ecosystem, offering:
|
|
8
|
+
|
|
9
|
+
- Complete Xano Headless API documentation
|
|
10
|
+
- XanoScript code validation and syntax checking
|
|
11
|
+
- XanoScript programming language documentation with examples
|
|
12
|
+
- Development workflows and best practices
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### Claude Code (Recommended)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
claude mcp add xano-developer -- npx -y @xano/developer-mcp
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
That's it! The MCP server will be automatically installed and configured.
|
|
23
|
+
|
|
24
|
+
### Claude Desktop
|
|
25
|
+
|
|
26
|
+
Add to your Claude Desktop configuration file:
|
|
27
|
+
|
|
28
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
29
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"xano-developer": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "@xano/developer-mcp"]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Installation from Source
|
|
43
|
+
|
|
44
|
+
### Prerequisites
|
|
45
|
+
|
|
46
|
+
- Node.js (ES2022+ compatible)
|
|
47
|
+
- npm
|
|
48
|
+
|
|
49
|
+
### Setup
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Clone the repository
|
|
53
|
+
git clone https://github.com/xano-inc/xano-developer-mcp.git
|
|
54
|
+
cd xano-developer-mcp
|
|
55
|
+
|
|
56
|
+
# Install dependencies
|
|
57
|
+
npm install
|
|
58
|
+
|
|
59
|
+
# Build the project
|
|
60
|
+
npm run build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
### Running the Server
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Production
|
|
69
|
+
npm start
|
|
70
|
+
|
|
71
|
+
# Development (build + run)
|
|
72
|
+
npm run dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The server communicates via stdio (standard input/output) using the JSON-RPC protocol, which is the standard transport for MCP servers.
|
|
76
|
+
|
|
77
|
+
### Source Install Configuration
|
|
78
|
+
|
|
79
|
+
If you installed from source, configure your MCP client to use the local build:
|
|
80
|
+
|
|
81
|
+
**Claude Code:**
|
|
82
|
+
```bash
|
|
83
|
+
claude mcp add xano-developer node /path/to/xano-developer-mcp/dist/index.js
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Claude Desktop:**
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"mcpServers": {
|
|
90
|
+
"xano-developer": {
|
|
91
|
+
"command": "node",
|
|
92
|
+
"args": ["/path/to/xano-developer-mcp/dist/index.js"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Available Tools
|
|
99
|
+
|
|
100
|
+
### 1. `api_docs`
|
|
101
|
+
|
|
102
|
+
Retrieves Xano Headless API documentation for specific resources.
|
|
103
|
+
|
|
104
|
+
**Parameters:**
|
|
105
|
+
| Parameter | Type | Required | Description |
|
|
106
|
+
|-----------|------|----------|-------------|
|
|
107
|
+
| `object` | string | No | Specific API resource to document |
|
|
108
|
+
|
|
109
|
+
**Available Objects:**
|
|
110
|
+
- `workspace` - Workspace management, branches, datasources, OpenAPI specs
|
|
111
|
+
- `table` - Database table schema management
|
|
112
|
+
- `api_group` - API groups and endpoints management
|
|
113
|
+
- `function` - Reusable function library
|
|
114
|
+
- `task` - Scheduled tasks (cron jobs)
|
|
115
|
+
- `middleware` - Request/response middleware
|
|
116
|
+
- `addon` - Response transformation queries
|
|
117
|
+
- `agent` - AI agent configuration
|
|
118
|
+
- `tool` - AI tool definitions for agents
|
|
119
|
+
- `mcp_server` - Model Context Protocol server management
|
|
120
|
+
- `realtime` - Realtime WebSocket channels
|
|
121
|
+
- `triggers` - Event-driven triggers
|
|
122
|
+
- `file` - File uploads and static hosting
|
|
123
|
+
- `history` - Request history and audit logs
|
|
124
|
+
- `authentication` - User authentication and session info
|
|
125
|
+
|
|
126
|
+
**Example:**
|
|
127
|
+
```
|
|
128
|
+
api_docs({ object: "workspace" })
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 2. `validate_xanoscript`
|
|
132
|
+
|
|
133
|
+
Validates XanoScript code for syntax errors. The language server auto-detects the object type from the code syntax.
|
|
134
|
+
|
|
135
|
+
**Parameters:**
|
|
136
|
+
| Parameter | Type | Required | Description |
|
|
137
|
+
|-----------|------|----------|-------------|
|
|
138
|
+
| `code` | string | Yes | The XanoScript code to validate |
|
|
139
|
+
|
|
140
|
+
**Example:**
|
|
141
|
+
```
|
|
142
|
+
validate_xanoscript({
|
|
143
|
+
code: "var:result = 1 + 2"
|
|
144
|
+
})
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Returns:** List of errors with line/column positions, or confirmation of validity.
|
|
148
|
+
|
|
149
|
+
### 3. `xanoscript_docs`
|
|
150
|
+
|
|
151
|
+
Retrieves XanoScript programming language documentation.
|
|
152
|
+
|
|
153
|
+
**Parameters:**
|
|
154
|
+
| Parameter | Type | Required | Description |
|
|
155
|
+
|-----------|------|----------|-------------|
|
|
156
|
+
| `keyword` | string | No | Documentation topic to retrieve |
|
|
157
|
+
|
|
158
|
+
**Supported Keywords:**
|
|
159
|
+
|
|
160
|
+
| Category | Keywords |
|
|
161
|
+
|----------|----------|
|
|
162
|
+
| Core Concepts | `function`, `api_query`, `table`, `task`, `tool`, `agent`, `mcp_server` |
|
|
163
|
+
| Language Reference | `syntax`, `expressions`, `input`, `db_query`, `query_filter` |
|
|
164
|
+
| Workflows | `workflow`, `function_workflow`, `api_workflow`, `table_workflow`, `task_workflow` |
|
|
165
|
+
| Special Topics | `frontend`, `lovable`, `testing`, `tips`, `ephemeral` |
|
|
166
|
+
|
|
167
|
+
**Aliases:** The tool supports keyword aliases for convenience:
|
|
168
|
+
- `api`, `apis`, `query`, `endpoint` → `api_query`
|
|
169
|
+
- `func` → `function`
|
|
170
|
+
- `db` → `db_query`
|
|
171
|
+
|
|
172
|
+
**Example:**
|
|
173
|
+
```
|
|
174
|
+
xanoscript_docs({ keyword: "function" })
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## npm Scripts
|
|
178
|
+
|
|
179
|
+
| Script | Command | Description |
|
|
180
|
+
|--------|---------|-------------|
|
|
181
|
+
| `build` | `tsc` | Compile TypeScript to JavaScript |
|
|
182
|
+
| `start` | `node dist/index.js` | Run the MCP server |
|
|
183
|
+
| `dev` | `tsc && node dist/index.js` | Build and run in development |
|
|
184
|
+
| `sync-docs` | `npx ts-node scripts/sync-xanoscript-docs.ts` | Regenerate XanoScript documentation mapping |
|
|
185
|
+
|
|
186
|
+
## Project Structure
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
xano-developer-mcp/
|
|
190
|
+
├── src/
|
|
191
|
+
│ ├── index.ts # Main MCP server implementation
|
|
192
|
+
│ └── xanoscript.d.ts # TypeScript declarations
|
|
193
|
+
├── dist/ # Compiled JavaScript output
|
|
194
|
+
├── scripts/
|
|
195
|
+
│ └── sync-xanoscript-docs.ts # Documentation sync script
|
|
196
|
+
├── api_docs/ # Xano API documentation (16 markdown files)
|
|
197
|
+
│ ├── index.md
|
|
198
|
+
│ ├── workspace.md
|
|
199
|
+
│ ├── table.md
|
|
200
|
+
│ └── ...
|
|
201
|
+
├── xanoscript_docs/ # XanoScript language documentation
|
|
202
|
+
│ ├── version.json
|
|
203
|
+
│ ├── function_guideline.md
|
|
204
|
+
│ ├── function_examples.md
|
|
205
|
+
│ └── ...
|
|
206
|
+
├── package.json
|
|
207
|
+
└── tsconfig.json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Dependencies
|
|
211
|
+
|
|
212
|
+
| Package | Version | Purpose |
|
|
213
|
+
|---------|---------|---------|
|
|
214
|
+
| `@modelcontextprotocol/sdk` | 1.26.0 | Official MCP SDK |
|
|
215
|
+
| `@xano/xanoscript-language-server` | 11.6.3 | XanoScript parser and validation |
|
|
216
|
+
|
|
217
|
+
## How It Works
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
AI Client
|
|
221
|
+
│
|
|
222
|
+
▼
|
|
223
|
+
MCP Protocol (JSON-RPC over stdio)
|
|
224
|
+
│
|
|
225
|
+
▼
|
|
226
|
+
Xano Developer MCP Server
|
|
227
|
+
│
|
|
228
|
+
├─► api_docs → Reads /api_docs/*.md files
|
|
229
|
+
│
|
|
230
|
+
├─► validate_xanoscript → Parses code with XanoScript language server
|
|
231
|
+
│
|
|
232
|
+
└─► xanoscript_docs → Reads external XanoScript documentation
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Authentication
|
|
236
|
+
|
|
237
|
+
The MCP server itself does not require authentication. However, when using the documented APIs to interact with actual Xano services, you will need appropriate Xano Headless API credentials.
|
|
238
|
+
|
|
239
|
+
## Development
|
|
240
|
+
|
|
241
|
+
### Syncing Documentation
|
|
242
|
+
|
|
243
|
+
If the XanoScript documentation source changes, regenerate the mapping:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
npm run sync-docs
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
This scans the xanoscript-ai-documentation directory and updates the documentation mapping in the server.
|
|
250
|
+
|
|
251
|
+
### Building
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npm run build
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Compiles TypeScript to JavaScript in the `dist/` directory.
|
|
258
|
+
|
|
259
|
+
## License
|
|
260
|
+
|
|
261
|
+
See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Addon API
|
|
2
|
+
|
|
3
|
+
Addons are reusable query components that can be attached to API responses to transform or enrich data. They're commonly used for joining related data or formatting output.
|
|
4
|
+
|
|
5
|
+
## Endpoints Overview
|
|
6
|
+
|
|
7
|
+
| Method | Endpoint | Description |
|
|
8
|
+
|--------|----------|-------------|
|
|
9
|
+
| GET | `/workspace/{workspace_id}/addon` | List addons |
|
|
10
|
+
| GET | `/workspace/{workspace_id}/addon/{addon_id}` | Get addon |
|
|
11
|
+
| POST | `/workspace/{workspace_id}/addon` | Create addon |
|
|
12
|
+
| PUT | `/workspace/{workspace_id}/addon/{addon_id}` | Update addon |
|
|
13
|
+
| DELETE | `/workspace/{workspace_id}/addon/{addon_id}` | Delete addon |
|
|
14
|
+
| PUT | `/workspace/{workspace_id}/addon/{addon_id}/security` | Update security |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## List Addons
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
GET /workspace/{workspace_id}/addon
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Query Parameters:**
|
|
25
|
+
| Parameter | Type | Default | Description |
|
|
26
|
+
|-----------|------|---------|-------------|
|
|
27
|
+
| `branch` | text | "" | Branch label |
|
|
28
|
+
| `page` | int | 1 | Page number |
|
|
29
|
+
| `per_page` | int | 50 | Items per page (1-10000) |
|
|
30
|
+
| `search` | text | "" | Search filter |
|
|
31
|
+
| `sort` | enum | "created_at" | Sort field |
|
|
32
|
+
| `order` | enum | "desc" | Sort order |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Get Addon
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
GET /workspace/{workspace_id}/addon/{addon_id}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Returns addon definition including XanoScript.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Create Addon
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
POST /workspace/{workspace_id}/addon
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Content-Type:** `text/x-xanoscript`
|
|
53
|
+
|
|
54
|
+
**Query Parameters:**
|
|
55
|
+
- `branch` (text): Target branch label
|
|
56
|
+
|
|
57
|
+
### XanoScript Addon Syntax
|
|
58
|
+
|
|
59
|
+
```xanoscript
|
|
60
|
+
addon foo {
|
|
61
|
+
input {
|
|
62
|
+
int foo_id {
|
|
63
|
+
dbtable = "foo"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
stack {
|
|
68
|
+
db.query foo {
|
|
69
|
+
where = $db.foo.id == $input.foo_id
|
|
70
|
+
return = {type: "single"}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Input Section
|
|
77
|
+
|
|
78
|
+
Define input parameters that link to database fields:
|
|
79
|
+
|
|
80
|
+
```xanoscript
|
|
81
|
+
input {
|
|
82
|
+
int user_id {
|
|
83
|
+
dbtable = "user" // Links to user table
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The `dbtable` property specifies which table field to join on.
|
|
89
|
+
|
|
90
|
+
### Stack Section
|
|
91
|
+
|
|
92
|
+
Query logic to fetch related data:
|
|
93
|
+
|
|
94
|
+
```xanoscript
|
|
95
|
+
stack {
|
|
96
|
+
db.query user {
|
|
97
|
+
where = $db.user.id == $input.user_id
|
|
98
|
+
return = {type: "single"}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Use Cases
|
|
104
|
+
|
|
105
|
+
- Join related data (e.g., fetch author for a post)
|
|
106
|
+
- Computed fields
|
|
107
|
+
- Data aggregation
|
|
108
|
+
- Response transformation
|
|
109
|
+
|
|
110
|
+
### Example: Author Addon
|
|
111
|
+
|
|
112
|
+
```xanoscript
|
|
113
|
+
addon author_info {
|
|
114
|
+
input {
|
|
115
|
+
int author_id {
|
|
116
|
+
dbtable = "user"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
stack {
|
|
121
|
+
db.query user {
|
|
122
|
+
select = ["id", "name", "avatar"]
|
|
123
|
+
where = $db.user.id == $input.author_id
|
|
124
|
+
return = {type: "single"}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Example: Order Summary Addon
|
|
131
|
+
|
|
132
|
+
```xanoscript
|
|
133
|
+
addon order_summary {
|
|
134
|
+
input {
|
|
135
|
+
int order_id {
|
|
136
|
+
dbtable = "order"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
stack {
|
|
141
|
+
// Get order items
|
|
142
|
+
db.query order_item {
|
|
143
|
+
where = $db.order_item.order_id == $input.order_id
|
|
144
|
+
return = {type: "list"}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Calculate totals
|
|
148
|
+
var $item_count {
|
|
149
|
+
value = count($order_item)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
var $total {
|
|
153
|
+
value = sum($order_item, "price")
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Update Addon
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
PUT /workspace/{workspace_id}/addon/{addon_id}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Query Parameters:**
|
|
168
|
+
- `publish` (bool, default: true): Publish changes immediately
|
|
169
|
+
|
|
170
|
+
**Content-Type:** `text/x-xanoscript`
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Delete Addon
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
DELETE /workspace/{workspace_id}/addon/{addon_id}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Warning:** This action cannot be undone.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Update Addon Security
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
PUT /workspace/{workspace_id}/addon/{addon_id}/security
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Parameters:**
|
|
191
|
+
| Parameter | Type | Required | Description |
|
|
192
|
+
|-----------|------|----------|-------------|
|
|
193
|
+
| `guid` | text | Yes | New security GUID |
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Agent API
|
|
2
|
+
|
|
3
|
+
Agents are AI-powered assistants that can use tools to accomplish tasks. They are configured with an LLM provider, system prompt, and available tools.
|
|
4
|
+
|
|
5
|
+
## Endpoints Overview
|
|
6
|
+
|
|
7
|
+
| Method | Endpoint | Description |
|
|
8
|
+
|--------|----------|-------------|
|
|
9
|
+
| GET | `/workspace/{workspace_id}/agent` | List agents |
|
|
10
|
+
| GET | `/workspace/{workspace_id}/agent/{agent_id}` | Get agent |
|
|
11
|
+
| POST | `/workspace/{workspace_id}/agent` | Create agent |
|
|
12
|
+
| PUT | `/workspace/{workspace_id}/agent/{agent_id}` | Update agent |
|
|
13
|
+
| DELETE | `/workspace/{workspace_id}/agent/{agent_id}` | Delete agent |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## List Agents
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
GET /workspace/{workspace_id}/agent
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Query Parameters:**
|
|
24
|
+
| Parameter | Type | Default | Description |
|
|
25
|
+
|-----------|------|---------|-------------|
|
|
26
|
+
| `branch` | text | "" | Branch label |
|
|
27
|
+
| `page` | int | 1 | Page number |
|
|
28
|
+
| `per_page` | int | 50 | Items per page (1-10000) |
|
|
29
|
+
| `search` | text | "" | Search filter |
|
|
30
|
+
| `sort` | enum | "created_at" | Sort field |
|
|
31
|
+
| `order` | enum | "desc" | Sort order |
|
|
32
|
+
| `tools` | bool | true | Include tool information |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Get Agent
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
GET /workspace/{workspace_id}/agent/{agent_id}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Query Parameters:**
|
|
43
|
+
- `tools` (bool, default: true): Include tool information
|
|
44
|
+
|
|
45
|
+
Returns agent definition including LLM configuration and XanoScript.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Create Agent
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
POST /workspace/{workspace_id}/agent
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Content-Type:** `text/x-xanoscript`
|
|
56
|
+
|
|
57
|
+
**Query Parameters:**
|
|
58
|
+
- `branch` (text): Target branch label
|
|
59
|
+
- `tools` (bool): Include tool information in response
|
|
60
|
+
|
|
61
|
+
### XanoScript Agent Syntax
|
|
62
|
+
|
|
63
|
+
```xanoscript
|
|
64
|
+
agent foo {
|
|
65
|
+
canonical = "custom"
|
|
66
|
+
llm = {
|
|
67
|
+
type : "anthropic"
|
|
68
|
+
system_prompt: "You are a helpful AI Agent."
|
|
69
|
+
max_steps : 5
|
|
70
|
+
prompt : ""
|
|
71
|
+
model : "claude-4-sonnet-20250514"
|
|
72
|
+
temperature : 1
|
|
73
|
+
reasoning : true
|
|
74
|
+
baseURL : ""
|
|
75
|
+
headers : ""
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### LLM Configuration
|
|
81
|
+
|
|
82
|
+
| Field | Type | Description |
|
|
83
|
+
|-------|------|-------------|
|
|
84
|
+
| `type` | text | LLM provider: "anthropic", "openai", etc. |
|
|
85
|
+
| `system_prompt` | text | Instructions for agent behavior |
|
|
86
|
+
| `max_steps` | int | Maximum tool calls per request |
|
|
87
|
+
| `model` | text | Model identifier |
|
|
88
|
+
| `temperature` | float | Response randomness (0-2) |
|
|
89
|
+
| `reasoning` | bool | Enable extended thinking |
|
|
90
|
+
| `baseURL` | text | Custom API endpoint (optional) |
|
|
91
|
+
| `headers` | text | Custom headers (optional) |
|
|
92
|
+
|
|
93
|
+
### Available LLM Providers
|
|
94
|
+
|
|
95
|
+
| Provider | Type Value |
|
|
96
|
+
|----------|------------|
|
|
97
|
+
| Anthropic | `"anthropic"` |
|
|
98
|
+
| OpenAI | `"openai"` |
|
|
99
|
+
|
|
100
|
+
### Example: Customer Support Agent
|
|
101
|
+
|
|
102
|
+
```xanoscript
|
|
103
|
+
agent support_bot {
|
|
104
|
+
canonical = "support"
|
|
105
|
+
llm = {
|
|
106
|
+
type : "anthropic"
|
|
107
|
+
system_prompt: "You are a customer support agent. Help users with their questions about our products. Be friendly and professional."
|
|
108
|
+
max_steps : 10
|
|
109
|
+
model : "claude-4-sonnet-20250514"
|
|
110
|
+
temperature : 0.7
|
|
111
|
+
reasoning : true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Example: Data Analysis Agent
|
|
117
|
+
|
|
118
|
+
```xanoscript
|
|
119
|
+
agent data_analyst {
|
|
120
|
+
canonical = "analyst"
|
|
121
|
+
llm = {
|
|
122
|
+
type : "anthropic"
|
|
123
|
+
system_prompt: "You are a data analyst. Help users understand their data by running queries and providing insights. Always explain your findings clearly."
|
|
124
|
+
max_steps : 15
|
|
125
|
+
model : "claude-4-sonnet-20250514"
|
|
126
|
+
temperature : 0.3
|
|
127
|
+
reasoning : true
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Update Agent
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
PUT /workspace/{workspace_id}/agent/{agent_id}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Query Parameters:**
|
|
141
|
+
- `publish` (bool, default: true): Publish changes immediately
|
|
142
|
+
- `tools` (bool, default: true): Include tool information in response
|
|
143
|
+
|
|
144
|
+
**Content-Type:** `text/x-xanoscript`
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Delete Agent
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
DELETE /workspace/{workspace_id}/agent/{agent_id}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Warning:** This action cannot be undone.
|