@lowdefy/docs-content 0.0.0-experimental-20260710073520
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 +201 -0
- package/README.md +20 -0
- package/content/actions/callapi.md +66 -0
- package/content/actions/callmethod.md +41 -0
- package/content/actions/copytoclipboard.md +32 -0
- package/content/actions/displaymessage.md +53 -0
- package/content/actions/downloadcsv.md +89 -0
- package/content/actions/fetch.md +50 -0
- package/content/actions/geolocationcurrentposition.md +56 -0
- package/content/actions/link.md +104 -0
- package/content/actions/login.md +85 -0
- package/content/actions/logout.md +56 -0
- package/content/actions/pdfmake.md +304 -0
- package/content/actions/request.md +67 -0
- package/content/actions/reset.md +27 -0
- package/content/actions/resetvalidation.md +85 -0
- package/content/actions/scrollto.md +85 -0
- package/content/actions/setdarkmode.md +62 -0
- package/content/actions/setfocus.md +33 -0
- package/content/actions/setglobal.md +63 -0
- package/content/actions/setlocale.md +69 -0
- package/content/actions/setstate.md +70 -0
- package/content/actions/throw.md +72 -0
- package/content/actions/validate.md +87 -0
- package/content/actions/wait.md +24 -0
- package/content/agents/agent-endpoint-tools.md +190 -0
- package/content/agents/agent-mcp-tools.md +124 -0
- package/content/agents/agent-multi-agent.md +136 -0
- package/content/agents/agent-properties.md +174 -0
- package/content/agents/agent-server-hooks.md +336 -0
- package/content/agents/agentchat.md +515 -0
- package/content/agents/agentconversations.md +148 -0
- package/content/concepts/ai-agent-docs.md +190 -0
- package/content/concepts/cli.md +213 -0
- package/content/concepts/connections-and-requests.md +7 -0
- package/content/concepts/custom-html.md +3 -0
- package/content/concepts/custom-styling.md +161 -0
- package/content/concepts/events-and-actions.md +271 -0
- package/content/concepts/hosting-files.md +18 -0
- package/content/concepts/i18n.md +320 -0
- package/content/concepts/keyboard-shortcuts.md +218 -0
- package/content/concepts/layout-overview.md +478 -0
- package/content/concepts/lists.md +144 -0
- package/content/concepts/logger.md +43 -0
- package/content/concepts/lowdefy-schema.md +365 -0
- package/content/concepts/menus.md +144 -0
- package/content/concepts/module-authoring.md +564 -0
- package/content/concepts/modules.md +338 -0
- package/content/concepts/operators.md +45 -0
- package/content/concepts/overview.md +19 -0
- package/content/concepts/references-and-templates.md +207 -0
- package/content/concepts/secrets.md +24 -0
- package/content/concepts/selectors.md +143 -0
- package/content/connections/amazonredshift.md +176 -0
- package/content/connections/anthropic.md +232 -0
- package/content/connections/awss3.md +313 -0
- package/content/connections/azureblobstorage.md +133 -0
- package/content/connections/elasticsearch.md +371 -0
- package/content/connections/google.md +228 -0
- package/content/connections/googlecloudstorage.md +139 -0
- package/content/connections/googlesheet.md +313 -0
- package/content/connections/knex.md +206 -0
- package/content/connections/mariadb.md +177 -0
- package/content/connections/mcp.md +134 -0
- package/content/connections/mongodb.md +739 -0
- package/content/connections/mssql.md +191 -0
- package/content/connections/mysql.md +192 -0
- package/content/connections/openai-connection.md +228 -0
- package/content/connections/postgresql.md +200 -0
- package/content/connections/redis.md +116 -0
- package/content/connections/sendgridmail.md +94 -0
- package/content/connections/smtp.md +149 -0
- package/content/connections/sqlite.md +187 -0
- package/content/connections/stripe.md +115 -0
- package/content/container-blocks/affix.md +413 -0
- package/content/container-blocks/alert.md +937 -0
- package/content/container-blocks/badge.md +1222 -0
- package/content/container-blocks/box.md +1453 -0
- package/content/container-blocks/card.md +1200 -0
- package/content/container-blocks/carousel.md +2247 -0
- package/content/container-blocks/collapse.md +1335 -0
- package/content/container-blocks/configprovider.md +1070 -0
- package/content/container-blocks/confirmmodal.md +1159 -0
- package/content/container-blocks/content.md +597 -0
- package/content/container-blocks/descriptions.md +870 -0
- package/content/container-blocks/drawer.md +1379 -0
- package/content/container-blocks/dropdownmenu.md +643 -0
- package/content/container-blocks/flex.md +1510 -0
- package/content/container-blocks/footer.md +380 -0
- package/content/container-blocks/googlemaps.md +546 -0
- package/content/container-blocks/googlemapsheatmap.md +607 -0
- package/content/container-blocks/googlemapsscript.md +61 -0
- package/content/container-blocks/header.md +302 -0
- package/content/container-blocks/label.md +739 -0
- package/content/container-blocks/layout.md +604 -0
- package/content/container-blocks/masonry.md +1090 -0
- package/content/container-blocks/mobilemenu.md +1244 -0
- package/content/container-blocks/modal.md +1180 -0
- package/content/container-blocks/pageheadermenu.md +614 -0
- package/content/container-blocks/pagesidebarlayout.md +438 -0
- package/content/container-blocks/pagesidermenu.md +651 -0
- package/content/container-blocks/popover.md +1421 -0
- package/content/container-blocks/result.md +972 -0
- package/content/container-blocks/sider.md +1064 -0
- package/content/container-blocks/span.md +747 -0
- package/content/container-blocks/spinner.md +267 -0
- package/content/container-blocks/splitter.md +1735 -0
- package/content/container-blocks/tabs.md +1718 -0
- package/content/container-blocks/tooltip.md +1274 -0
- package/content/container-blocks/watermark.md +515 -0
- package/content/controls/for.md +103 -0
- package/content/controls/if.md +107 -0
- package/content/controls/log.md +50 -0
- package/content/controls/parallel.md +71 -0
- package/content/controls/parallel_for.md +36 -0
- package/content/controls/reject.md +56 -0
- package/content/controls/return.md +66 -0
- package/content/controls/set_state.md +98 -0
- package/content/controls/switch.md +90 -0
- package/content/controls/throw.md +79 -0
- package/content/controls/try.md +88 -0
- package/content/deployment/docker.md +149 -0
- package/content/deployment/node-server.md +27 -0
- package/content/deployment/vercel.md +101 -0
- package/content/display-blocks/aggrid.md +1459 -0
- package/content/display-blocks/anchor.md +336 -0
- package/content/display-blocks/avatar.md +1154 -0
- package/content/display-blocks/breadcrumb.md +517 -0
- package/content/display-blocks/button.md +758 -0
- package/content/display-blocks/calendar.md +156 -0
- package/content/display-blocks/dangeroushtml.md +314 -0
- package/content/display-blocks/dangerousmarkdown.md +423 -0
- package/content/display-blocks/diffgit.md +44 -0
- package/content/display-blocks/difflist.md +225 -0
- package/content/display-blocks/diffsidebyside.md +56 -0
- package/content/display-blocks/difftimeline.md +94 -0
- package/content/display-blocks/divider.md +406 -0
- package/content/display-blocks/download.md +60 -0
- package/content/display-blocks/dropdownbutton.md +661 -0
- package/content/display-blocks/echart.md +418 -0
- package/content/display-blocks/floatbutton.md +545 -0
- package/content/display-blocks/html.md +311 -0
- package/content/display-blocks/icon.md +717 -0
- package/content/display-blocks/img.md +479 -0
- package/content/display-blocks/markdown.md +520 -0
- package/content/display-blocks/markdownwithcode.md +730 -0
- package/content/display-blocks/menu.md +1123 -0
- package/content/display-blocks/message.md +941 -0
- package/content/display-blocks/notification.md +1410 -0
- package/content/display-blocks/paragraph.md +643 -0
- package/content/display-blocks/progress.md +818 -0
- package/content/display-blocks/qrcode.md +519 -0
- package/content/display-blocks/s3download.md +240 -0
- package/content/display-blocks/search.md +360 -0
- package/content/display-blocks/skeleton.md +272 -0
- package/content/display-blocks/skeletonavatar.md +222 -0
- package/content/display-blocks/skeletonbutton.md +245 -0
- package/content/display-blocks/skeletoninput.md +223 -0
- package/content/display-blocks/skeletonparagraph.md +201 -0
- package/content/display-blocks/statistic.md +485 -0
- package/content/display-blocks/steps.md +585 -0
- package/content/display-blocks/tag.md +620 -0
- package/content/display-blocks/title.md +654 -0
- package/content/display-blocks/tour.md +2359 -0
- package/content/input-blocks/autocomplete.md +786 -0
- package/content/input-blocks/buttonselector.md +964 -0
- package/content/input-blocks/checkboxselector.md +765 -0
- package/content/input-blocks/checkboxswitch.md +497 -0
- package/content/input-blocks/colorselector.md +884 -0
- package/content/input-blocks/daterangeselector.md +777 -0
- package/content/input-blocks/dateselector.md +693 -0
- package/content/input-blocks/datetimeselector.md +791 -0
- package/content/input-blocks/inputgallery.md +528 -0
- package/content/input-blocks/monthselector.md +717 -0
- package/content/input-blocks/multipleselector.md +1337 -0
- package/content/input-blocks/numberinput.md +855 -0
- package/content/input-blocks/pagination.md +679 -0
- package/content/input-blocks/paragraphinput.md +1664 -0
- package/content/input-blocks/passwordinput.md +480 -0
- package/content/input-blocks/phonenumberinput.md +688 -0
- package/content/input-blocks/radioselector.md +820 -0
- package/content/input-blocks/ratingslider.md +684 -0
- package/content/input-blocks/s3uploadbutton.md +384 -0
- package/content/input-blocks/s3uploaddragger.md +305 -0
- package/content/input-blocks/s3uploadphoto.md +288 -0
- package/content/input-blocks/segmentedselector.md +782 -0
- package/content/input-blocks/selector.md +1162 -0
- package/content/input-blocks/switch.md +552 -0
- package/content/input-blocks/textarea.md +714 -0
- package/content/input-blocks/textinput.md +639 -0
- package/content/input-blocks/tiptapinput.md +226 -0
- package/content/input-blocks/tiptapmentioninput.md +471 -0
- package/content/input-blocks/titleinput.md +1094 -0
- package/content/input-blocks/treeinput.md +144 -0
- package/content/input-blocks/treemultipleselector.md +162 -0
- package/content/input-blocks/treeselector.md +185 -0
- package/content/input-blocks/upload.md +149 -0
- package/content/input-blocks/uploaddragger.md +85 -0
- package/content/input-blocks/uploadphoto.md +84 -0
- package/content/input-blocks/weekselector.md +630 -0
- package/content/list-blocks/controlledlist.md +498 -0
- package/content/list-blocks/list.md +529 -0
- package/content/list-blocks/listselector.md +301 -0
- package/content/list-blocks/masonrylist.md +230 -0
- package/content/migration/upgrade-guide.md +106 -0
- package/content/migration/v4-to-v5.md +589 -0
- package/content/migration/v5-to-v6.md +36 -0
- package/content/operators/_actions.md +58 -0
- package/content/operators/_and.md +76 -0
- package/content/operators/_api.md +254 -0
- package/content/operators/_app.md +114 -0
- package/content/operators/_args.md +65 -0
- package/content/operators/_array.md +331 -0
- package/content/operators/_base64.md +49 -0
- package/content/operators/_boolean.md +33 -0
- package/content/operators/_build.md +166 -0
- package/content/operators/_change_case.md +357 -0
- package/content/operators/_date.md +415 -0
- package/content/operators/_dayjs.md +128 -0
- package/content/operators/_diff.md +61 -0
- package/content/operators/_divide.md +32 -0
- package/content/operators/_eq.md +52 -0
- package/content/operators/_event.md +86 -0
- package/content/operators/_function.md +52 -0
- package/content/operators/_get.md +92 -0
- package/content/operators/_global.md +86 -0
- package/content/operators/_gt.md +50 -0
- package/content/operators/_gte.md +50 -0
- package/content/operators/_hash.md +112 -0
- package/content/operators/_if.md +30 -0
- package/content/operators/_if_none.md +47 -0
- package/content/operators/_index.md +48 -0
- package/content/operators/_input.md +86 -0
- package/content/operators/_intl.md +135 -0
- package/content/operators/_item.md +166 -0
- package/content/operators/_js.md +113 -0
- package/content/operators/_json.md +120 -0
- package/content/operators/_jsonata.md +152 -0
- package/content/operators/_locale.md +65 -0
- package/content/operators/_location.md +40 -0
- package/content/operators/_log.md +22 -0
- package/content/operators/_lt.md +50 -0
- package/content/operators/_lte.md +50 -0
- package/content/operators/_math.md +407 -0
- package/content/operators/_media.md +83 -0
- package/content/operators/_menu.md +62 -0
- package/content/operators/_module.md +340 -0
- package/content/operators/_mql.md +95 -0
- package/content/operators/_ne.md +62 -0
- package/content/operators/_not.md +33 -0
- package/content/operators/_number.md +159 -0
- package/content/operators/_nunjucks.md +117 -0
- package/content/operators/_object.md +253 -0
- package/content/operators/_operator.md +33 -0
- package/content/operators/_or.md +67 -0
- package/content/operators/_product.md +45 -0
- package/content/operators/_random.md +90 -0
- package/content/operators/_ref.md +80 -0
- package/content/operators/_regex.md +69 -0
- package/content/operators/_request.md +35 -0
- package/content/operators/_request_details.md +29 -0
- package/content/operators/_secret.md +56 -0
- package/content/operators/_state.md +134 -0
- package/content/operators/_step.md +98 -0
- package/content/operators/_string.md +327 -0
- package/content/operators/_subtract.md +24 -0
- package/content/operators/_sum.md +45 -0
- package/content/operators/_switch.md +37 -0
- package/content/operators/_t.md +96 -0
- package/content/operators/_theme.md +65 -0
- package/content/operators/_type.md +78 -0
- package/content/operators/_uri.md +49 -0
- package/content/operators/_url_query.md +92 -0
- package/content/operators/_user.md +154 -0
- package/content/operators/_uuid.md +118 -0
- package/content/operators/_var.md +88 -0
- package/content/operators/_yaml.md +96 -0
- package/content/other/introduction.md +39 -0
- package/content/other/next-auth-providers.md +3 -0
- package/content/other/updatesession.md +26 -0
- package/content/plugins/plugins-actions.md +80 -0
- package/content/plugins/plugins-connections.md +98 -0
- package/content/plugins/plugins-dev.md +138 -0
- package/content/plugins/plugins-introduction.md +29 -0
- package/content/plugins/plugins-operators.md +71 -0
- package/content/testing/e2e-auth.md +108 -0
- package/content/testing/e2e-configuration.md +107 -0
- package/content/testing/e2e-getting-started.md +96 -0
- package/content/testing/e2e-introduction.md +53 -0
- package/content/testing/e2e-mocking.md +155 -0
- package/content/testing/e2e-writing-tests.md +214 -0
- package/content/tutorial/tutorial-actions-operators.md +222 -0
- package/content/tutorial/tutorial-add-blocks.md +86 -0
- package/content/tutorial/tutorial-create-page.md +57 -0
- package/content/tutorial/tutorial-display-data-page.md +181 -0
- package/content/tutorial/tutorial-next-steps.md +53 -0
- package/content/tutorial/tutorial-requests-sql.md +22 -0
- package/content/tutorial/tutorial-start.md +71 -0
- package/content/user-authentication/auth-providers.md +15 -0
- package/content/user-authentication/login-and-logout.md +122 -0
- package/content/user-authentication/users-introduction.md +31 -0
- package/index.json +2281 -0
- package/package.json +34 -0
- package/scripts/extractAgentDocs.js +130 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Endpoint Tools
|
|
2
|
+
|
|
3
|
+
Endpoint tools connect your agent to your app's [API endpoints](/lowdefy-api). The model can call these tools during a conversation to query databases, call external APIs, create records, or any other server-side operation your endpoints support.
|
|
4
|
+
|
|
5
|
+
If you are not familiar with the Lowdefy API system, see the [APIs](/lowdefy-api) concept page first.
|
|
6
|
+
|
|
7
|
+
## Defining a Tool Endpoint
|
|
8
|
+
|
|
9
|
+
Any endpoint defined in the `api` section can be used as a tool, as long as it has a `description` and a `payloadSchema`. The description tells the model what the tool does, and the payload schema defines the input format.
|
|
10
|
+
|
|
11
|
+
> Well-written `description` and `payloadSchema.properties.*.description` fields are critical — they are all the model has to decide when to call the tool and what arguments to pass.
|
|
12
|
+
|
|
13
|
+
###### Search endpoint:
|
|
14
|
+
```yaml
|
|
15
|
+
api:
|
|
16
|
+
- id: search-articles
|
|
17
|
+
type: Api
|
|
18
|
+
description: >
|
|
19
|
+
Search knowledge base articles by topic. Returns matching
|
|
20
|
+
articles with title, summary, and content.
|
|
21
|
+
payloadSchema:
|
|
22
|
+
type: object
|
|
23
|
+
properties:
|
|
24
|
+
query:
|
|
25
|
+
type: string
|
|
26
|
+
description: Search term — can be a topic, keyword, or question.
|
|
27
|
+
limit:
|
|
28
|
+
type: integer
|
|
29
|
+
description: Maximum number of articles to return.
|
|
30
|
+
default: 5
|
|
31
|
+
required:
|
|
32
|
+
- query
|
|
33
|
+
routine:
|
|
34
|
+
- id: search
|
|
35
|
+
type: MongoDBFind
|
|
36
|
+
connectionId: kb_db
|
|
37
|
+
properties:
|
|
38
|
+
collection: articles
|
|
39
|
+
query:
|
|
40
|
+
$text:
|
|
41
|
+
$search:
|
|
42
|
+
_payload: query
|
|
43
|
+
options:
|
|
44
|
+
projection:
|
|
45
|
+
title: 1
|
|
46
|
+
summary: 1
|
|
47
|
+
content: 1
|
|
48
|
+
score:
|
|
49
|
+
$meta: textScore
|
|
50
|
+
sort:
|
|
51
|
+
score:
|
|
52
|
+
$meta: textScore
|
|
53
|
+
limit:
|
|
54
|
+
_payload: limit
|
|
55
|
+
- :return:
|
|
56
|
+
_step: search
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
###### Create endpoint:
|
|
60
|
+
```yaml
|
|
61
|
+
api:
|
|
62
|
+
- id: create-support-ticket
|
|
63
|
+
type: Api
|
|
64
|
+
description: >
|
|
65
|
+
Create a support ticket for issues that need human follow-up.
|
|
66
|
+
Returns the ticket number.
|
|
67
|
+
payloadSchema:
|
|
68
|
+
type: object
|
|
69
|
+
properties:
|
|
70
|
+
subject:
|
|
71
|
+
type: string
|
|
72
|
+
description: Short summary of the issue.
|
|
73
|
+
description:
|
|
74
|
+
type: string
|
|
75
|
+
description: Detailed description of the problem.
|
|
76
|
+
priority:
|
|
77
|
+
type: string
|
|
78
|
+
enum:
|
|
79
|
+
- low
|
|
80
|
+
- medium
|
|
81
|
+
- high
|
|
82
|
+
description: Ticket priority level.
|
|
83
|
+
required:
|
|
84
|
+
- subject
|
|
85
|
+
- description
|
|
86
|
+
routine:
|
|
87
|
+
- id: insert
|
|
88
|
+
type: MongoDBInsertOne
|
|
89
|
+
connectionId: tickets_db
|
|
90
|
+
properties:
|
|
91
|
+
doc:
|
|
92
|
+
subject:
|
|
93
|
+
_payload: subject
|
|
94
|
+
description:
|
|
95
|
+
_payload: description
|
|
96
|
+
priority:
|
|
97
|
+
_payload: priority
|
|
98
|
+
status: open
|
|
99
|
+
createdAt:
|
|
100
|
+
_date: now
|
|
101
|
+
userId:
|
|
102
|
+
_user: id
|
|
103
|
+
- :return:
|
|
104
|
+
ticketId:
|
|
105
|
+
_step: insert.insertedId
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
###### HTTP API call:
|
|
109
|
+
```yaml
|
|
110
|
+
api:
|
|
111
|
+
- id: get-weather
|
|
112
|
+
type: Api
|
|
113
|
+
description: >
|
|
114
|
+
Get current weather for a city. Returns temperature,
|
|
115
|
+
conditions, and forecast.
|
|
116
|
+
payloadSchema:
|
|
117
|
+
type: object
|
|
118
|
+
properties:
|
|
119
|
+
city:
|
|
120
|
+
type: string
|
|
121
|
+
description: City name (e.g. "London", "New York").
|
|
122
|
+
required:
|
|
123
|
+
- city
|
|
124
|
+
routine:
|
|
125
|
+
- id: fetch
|
|
126
|
+
type: AxiosHttp
|
|
127
|
+
connectionId: weather_api
|
|
128
|
+
properties:
|
|
129
|
+
url:
|
|
130
|
+
_string.concat:
|
|
131
|
+
- /current?city=
|
|
132
|
+
- _payload: city
|
|
133
|
+
- :return:
|
|
134
|
+
_step: fetch.data
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Referencing Tools in an Agent
|
|
138
|
+
|
|
139
|
+
Reference tools in the agent's `tools` array using a string shorthand or an object:
|
|
140
|
+
|
|
141
|
+
- `tools: array`: Each item is either:
|
|
142
|
+
- `string` — The endpoint `id`.
|
|
143
|
+
- `object`:
|
|
144
|
+
- `endpointId: string`: __Required__ - The endpoint `id`.
|
|
145
|
+
- `confirm: boolean`: When `true`, the user must approve the call before it executes.
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
agents:
|
|
149
|
+
- id: support_agent
|
|
150
|
+
type: ClaudeAgent
|
|
151
|
+
connectionId: anthropic
|
|
152
|
+
properties:
|
|
153
|
+
model: claude-sonnet-4-20250514
|
|
154
|
+
instructions: |
|
|
155
|
+
You are a support agent. Search the knowledge base before
|
|
156
|
+
answering. If you can't resolve the issue, create a ticket.
|
|
157
|
+
tools:
|
|
158
|
+
# String shorthand
|
|
159
|
+
- search-articles
|
|
160
|
+
# Object form with confirmation
|
|
161
|
+
- endpointId: create-support-ticket
|
|
162
|
+
confirm: true
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Reserved Tool Names
|
|
166
|
+
|
|
167
|
+
Lowdefy registers a small set of platform tools automatically (for example, `update-page-state`, which the [`AgentChat`](/AgentChat#shared-state) block wires up when `sharedState` is set). The following tool names are reserved and cannot be used as endpoint ids or sub-agent ids — the build will fail if one is encountered:
|
|
168
|
+
|
|
169
|
+
- `update-page-state`
|
|
170
|
+
- `read-file`
|
|
171
|
+
- `list-files`
|
|
172
|
+
- `search-files`
|
|
173
|
+
- `stat-file`
|
|
174
|
+
|
|
175
|
+
## Tool Confirmation
|
|
176
|
+
|
|
177
|
+
Setting `confirm: true` pauses the agent loop and shows approve/reject buttons in the [`AgentChat`](/AgentChat) block. The agent waits until the user responds before continuing.
|
|
178
|
+
|
|
179
|
+
Use confirmation for destructive or sensitive operations — deleting records, sending emails, making payments, etc.
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
tools:
|
|
183
|
+
- search-articles
|
|
184
|
+
- endpointId: create-support-ticket
|
|
185
|
+
confirm: true
|
|
186
|
+
- endpointId: send-email
|
|
187
|
+
confirm: true
|
|
188
|
+
- endpointId: delete-record
|
|
189
|
+
confirm: true
|
|
190
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# MCP Tools
|
|
2
|
+
|
|
3
|
+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard for connecting AI models to external tools and data sources. Lowdefy agents can connect to any MCP server, giving the agent access to all the tools that server provides.
|
|
4
|
+
|
|
5
|
+
MCP tools can be configured by referencing an [`Mcp` connection](/Mcp) or by defining the server inline on the agent.
|
|
6
|
+
|
|
7
|
+
## Using an Mcp Connection
|
|
8
|
+
|
|
9
|
+
Define an [`Mcp` connection](/Mcp), then reference it in the agent's `mcp` array:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
connections:
|
|
13
|
+
- id: mcp_github
|
|
14
|
+
type: Mcp
|
|
15
|
+
properties:
|
|
16
|
+
transport: stdio
|
|
17
|
+
command: npx
|
|
18
|
+
args:
|
|
19
|
+
- '-y'
|
|
20
|
+
- '@modelcontextprotocol/server-github'
|
|
21
|
+
env:
|
|
22
|
+
GITHUB_TOKEN:
|
|
23
|
+
_secret: GITHUB_TOKEN
|
|
24
|
+
|
|
25
|
+
agents:
|
|
26
|
+
- id: dev_assistant
|
|
27
|
+
type: ClaudeAgent
|
|
28
|
+
connectionId: anthropic
|
|
29
|
+
properties:
|
|
30
|
+
model: claude-sonnet-4-20250514
|
|
31
|
+
instructions: You help developers manage GitHub issues and PRs.
|
|
32
|
+
mcp:
|
|
33
|
+
# String shorthand — just the connection id
|
|
34
|
+
- mcp_github
|
|
35
|
+
# Object form (equivalent)
|
|
36
|
+
- connectionId: mcp_github
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The agent automatically discovers all tools the MCP server provides.
|
|
40
|
+
|
|
41
|
+
## Inline MCP Configuration
|
|
42
|
+
|
|
43
|
+
Define MCP servers directly on the agent without creating a separate connection:
|
|
44
|
+
|
|
45
|
+
###### Remote HTTP server:
|
|
46
|
+
```yaml
|
|
47
|
+
mcp:
|
|
48
|
+
- url: https://mcp.example.com/tools
|
|
49
|
+
transport: http
|
|
50
|
+
headers:
|
|
51
|
+
Authorization:
|
|
52
|
+
_string.concat:
|
|
53
|
+
- 'Bearer '
|
|
54
|
+
- _secret: MCP_API_KEY
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
###### Local stdio server:
|
|
58
|
+
```yaml
|
|
59
|
+
mcp:
|
|
60
|
+
- command: node
|
|
61
|
+
args:
|
|
62
|
+
- ./mcp-server/index.js
|
|
63
|
+
transport: stdio
|
|
64
|
+
env:
|
|
65
|
+
DATABASE_URL:
|
|
66
|
+
_secret: DATABASE_URL
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
###### Multiple servers on one agent:
|
|
70
|
+
```yaml
|
|
71
|
+
agents:
|
|
72
|
+
- id: assistant
|
|
73
|
+
type: ClaudeAgent
|
|
74
|
+
connectionId: anthropic
|
|
75
|
+
properties:
|
|
76
|
+
model: claude-sonnet-4-20250514
|
|
77
|
+
mcp:
|
|
78
|
+
- mcp_github
|
|
79
|
+
- url: https://mcp.example.com/tools
|
|
80
|
+
transport: http
|
|
81
|
+
- command: npx
|
|
82
|
+
args:
|
|
83
|
+
- '-y'
|
|
84
|
+
- '@modelcontextprotocol/server-filesystem'
|
|
85
|
+
- '/data/documents'
|
|
86
|
+
transport: stdio
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## MCP Properties
|
|
90
|
+
|
|
91
|
+
- `mcp: array`: Each item is either:
|
|
92
|
+
- `string` — The [`Mcp` connection](/Mcp) `id`.
|
|
93
|
+
- `object`:
|
|
94
|
+
- `connectionId: string`: Reference an [`Mcp` connection](/Mcp) by `id`.
|
|
95
|
+
- `url: string`: URL for HTTP or SSE transport.
|
|
96
|
+
- `transport: string`: Default: `'http'` - `'http'`, `'sse'`, or `'stdio'`.
|
|
97
|
+
- `headers: object`: HTTP headers (for `http`/`sse`). __Operators are evaluated__.
|
|
98
|
+
- `command: string`: Command to run (for `stdio`).
|
|
99
|
+
- `args: string[]`: Command arguments (for `stdio`).
|
|
100
|
+
- `env: object`: Environment variables (for `stdio`). __Operators are evaluated__.
|
|
101
|
+
- `confirm: boolean`: Require user approval for all tools from this server.
|
|
102
|
+
|
|
103
|
+
## Transports
|
|
104
|
+
|
|
105
|
+
| Transport | Use case | Required properties |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| `http` (default) | Remote MCP servers | `url` |
|
|
108
|
+
| `sse` | Servers using Server-Sent Events | `url` |
|
|
109
|
+
| `stdio` | Local processes, npm packages | `command` |
|
|
110
|
+
|
|
111
|
+
For HTTP and SSE transports, use `headers` to pass authentication. For stdio, use `command`, `args`, and `env` to configure the process.
|
|
112
|
+
|
|
113
|
+
See the [`Mcp` connection](/Mcp) page for more details on configuring MCP servers as reusable connections.
|
|
114
|
+
|
|
115
|
+
## Tool Confirmation
|
|
116
|
+
|
|
117
|
+
Setting `confirm: true` on an MCP source requires user approval for **all** tools from that server:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
mcp:
|
|
121
|
+
- url: https://mcp.example.com/admin-tools
|
|
122
|
+
transport: http
|
|
123
|
+
confirm: true
|
|
124
|
+
```
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Multi-Agent
|
|
2
|
+
|
|
3
|
+
An agent can delegate tasks to other agents defined in your app. Sub-agents are presented to the parent agent as tools — the parent sends a task description, the sub-agent processes it using its own instructions and tools, and returns a text response.
|
|
4
|
+
|
|
5
|
+
This lets you build systems where a general-purpose agent routes requests to specialized agents, each with their own instructions, tools, and model settings.
|
|
6
|
+
|
|
7
|
+
## Defining Sub-Agents
|
|
8
|
+
|
|
9
|
+
Define the sub-agent as a regular agent, then reference it in the parent agent's `agents` array:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
agents:
|
|
13
|
+
- id: researcher
|
|
14
|
+
type: ClaudeAgent
|
|
15
|
+
connectionId: anthropic
|
|
16
|
+
properties:
|
|
17
|
+
model: claude-sonnet-4-20250514
|
|
18
|
+
instructions: You research and summarize information about products.
|
|
19
|
+
tools:
|
|
20
|
+
- search-products
|
|
21
|
+
- get-product-details
|
|
22
|
+
|
|
23
|
+
- id: assistant
|
|
24
|
+
type: ClaudeAgent
|
|
25
|
+
connectionId: anthropic
|
|
26
|
+
properties:
|
|
27
|
+
model: claude-sonnet-4-20250514
|
|
28
|
+
instructions: |
|
|
29
|
+
You are a helpful assistant. When users ask about products,
|
|
30
|
+
delegate the research to the researcher agent.
|
|
31
|
+
agents:
|
|
32
|
+
- agentId: researcher
|
|
33
|
+
description: Research and summarize product information.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The `description` tells the parent model when to delegate. Write it clearly — it's the only thing the parent sees about the sub-agent's capabilities.
|
|
37
|
+
|
|
38
|
+
## Sub-Agent Options
|
|
39
|
+
|
|
40
|
+
- `agents: array`: Each item is either:
|
|
41
|
+
- `string` — The sub-agent `id`. Uses the sub-agent's instructions as the tool description.
|
|
42
|
+
- `object`:
|
|
43
|
+
- `agentId: string`: __Required__ - The sub-agent `id`.
|
|
44
|
+
- `description: string`: Description sent to the parent model.
|
|
45
|
+
- `inputSchema: object`: JSON Schema for structured input. When provided, the parent generates structured input matching this schema instead of freeform text.
|
|
46
|
+
|
|
47
|
+
###### String shorthand:
|
|
48
|
+
```yaml
|
|
49
|
+
agents:
|
|
50
|
+
- researcher
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
###### With structured input:
|
|
54
|
+
```yaml
|
|
55
|
+
agents:
|
|
56
|
+
- agentId: report_generator
|
|
57
|
+
description: Generate formatted reports from data.
|
|
58
|
+
inputSchema:
|
|
59
|
+
type: object
|
|
60
|
+
properties:
|
|
61
|
+
reportType:
|
|
62
|
+
type: string
|
|
63
|
+
enum:
|
|
64
|
+
- summary
|
|
65
|
+
- detailed
|
|
66
|
+
- executive
|
|
67
|
+
description: The type of report to generate.
|
|
68
|
+
dateRange:
|
|
69
|
+
type: string
|
|
70
|
+
description: Date range for the report (e.g. "last 30 days").
|
|
71
|
+
metrics:
|
|
72
|
+
type: array
|
|
73
|
+
items:
|
|
74
|
+
type: string
|
|
75
|
+
description: Metrics to include in the report.
|
|
76
|
+
required:
|
|
77
|
+
- reportType
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Routing Pattern
|
|
81
|
+
|
|
82
|
+
A common pattern is a router agent that delegates to specialized agents based on the user's intent:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
agents:
|
|
86
|
+
- id: billing_agent
|
|
87
|
+
type: ClaudeAgent
|
|
88
|
+
connectionId: anthropic
|
|
89
|
+
properties:
|
|
90
|
+
model: claude-sonnet-4-20250514
|
|
91
|
+
instructions: |
|
|
92
|
+
You handle billing questions. Look up invoices, explain
|
|
93
|
+
charges, and process refund requests.
|
|
94
|
+
tools:
|
|
95
|
+
- get-invoices
|
|
96
|
+
- get-payment-history
|
|
97
|
+
- endpointId: process-refund
|
|
98
|
+
confirm: true
|
|
99
|
+
|
|
100
|
+
- id: technical_agent
|
|
101
|
+
type: ClaudeAgent
|
|
102
|
+
connectionId: anthropic
|
|
103
|
+
properties:
|
|
104
|
+
model: claude-sonnet-4-20250514
|
|
105
|
+
instructions: |
|
|
106
|
+
You handle technical support. Diagnose issues, search
|
|
107
|
+
the knowledge base, and escalate if needed.
|
|
108
|
+
tools:
|
|
109
|
+
- search-articles
|
|
110
|
+
- check-service-status
|
|
111
|
+
|
|
112
|
+
- id: router
|
|
113
|
+
type: ClaudeAgent
|
|
114
|
+
connectionId: anthropic
|
|
115
|
+
properties:
|
|
116
|
+
model: claude-sonnet-4-20250514
|
|
117
|
+
instructions: |
|
|
118
|
+
You are the main support agent. Route billing questions
|
|
119
|
+
to the billing agent and technical issues to the
|
|
120
|
+
technical agent. Handle general questions yourself.
|
|
121
|
+
agents:
|
|
122
|
+
- agentId: billing_agent
|
|
123
|
+
description: Handles billing, invoices, payments, and refund requests.
|
|
124
|
+
- agentId: technical_agent
|
|
125
|
+
description: Handles technical issues, troubleshooting, and bug reports.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The user chats with the `router` agent via [`AgentChat`](/AgentChat). When the router delegates, the sub-agent runs server-side and returns its response to the router, which can then relay or build on it.
|
|
129
|
+
|
|
130
|
+
## Nesting and Limits
|
|
131
|
+
|
|
132
|
+
Sub-agents can themselves have sub-agents, up to **5 levels deep**. Circular references (agent A delegates to agent B, which delegates back to agent A) are detected at build time and cause a build error.
|
|
133
|
+
|
|
134
|
+
Sub-agents can use any combination of [endpoint tools](/agent-endpoint-tools), [MCP tools](/agent-mcp-tools), and [file system access](/agent-properties) — they are full agents with their own configuration.
|
|
135
|
+
|
|
136
|
+
> Tools with `confirm: true` are not supported on sub-agents, since sub-agents run server-side without direct user interaction. A build warning is shown if this is configured.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Agent Properties
|
|
2
|
+
|
|
3
|
+
Agent properties configure the model and its behavior. They are set in the `properties` object of the [agent definition](/agents-introduction). All properties support [operators](/operators), so you can use [`_secret`](/_secret), [`_user`](/_user), and other operators to set values dynamically.
|
|
4
|
+
|
|
5
|
+
## Model and Instructions
|
|
6
|
+
|
|
7
|
+
- `model: string`: __Required__ - The model identifier (e.g. `claude-sonnet-4-20250514`, `gpt-4o`, `gemini-2.5-pro`).
|
|
8
|
+
- `instructions: string`: System instructions that guide the agent's behavior. This is the system prompt sent to the model with every request. The string passes through the operator parser at request time, so `_t:` works for locale-aware prompts (see [i18n](/i18n)). Note: tool descriptions stay English — translating them can degrade tool-call accuracy on English-trained models.
|
|
9
|
+
- `pageContext: boolean`: Default: `false` - When `true`, prepend context about the current page, user, conversation, URL query, and shared state to the instructions. URL query and shared state are only included when the [`AgentChat`](/AgentChat) block sends them as `urlQuery` and `sharedState`. Useful when the agent needs to know who it's talking to or what the user has typed into form fields.
|
|
10
|
+
- `generateTitle: boolean`: Default: `false` - When `true`, generate a short title from the first user message on the first turn of a conversation. Emits a `data-chat-title` data part that fires the [`AgentChat`](/AgentChat) block's `onTitleGenerated` event. Runs concurrently with the response and is non-fatal — a failed title generation logs a warning and does not break the turn.
|
|
11
|
+
|
|
12
|
+
###### Instructions with user context:
|
|
13
|
+
```yaml
|
|
14
|
+
properties:
|
|
15
|
+
model: claude-sonnet-4-20250514
|
|
16
|
+
pageContext: true
|
|
17
|
+
instructions: |
|
|
18
|
+
You are a support agent for Acme Corp. You have access to the
|
|
19
|
+
current user's details via the page context. Use their name
|
|
20
|
+
when greeting them and tailor responses to their account.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Generation Settings
|
|
24
|
+
|
|
25
|
+
- `maxOutputTokens: integer`: Maximum tokens the model can generate per step.
|
|
26
|
+
- `temperature: number`: Sampling temperature between `0` and `2`. Lower values are more deterministic, higher values more creative. Default depends on the provider.
|
|
27
|
+
- `topP: number`: Nucleus sampling probability between `0` and `1`. Alternative to temperature — use one or the other.
|
|
28
|
+
- `topK: integer`: Only sample from the top K token options (not supported by all providers).
|
|
29
|
+
- `frequencyPenalty: number`: Penalty between `-1` and `1` for repeating tokens. `0` means no penalty.
|
|
30
|
+
- `presencePenalty: number`: Penalty between `-1` and `1` for using tokens that have appeared. `0` means no penalty.
|
|
31
|
+
- `seed: integer`: Seed for deterministic sampling (provider support varies).
|
|
32
|
+
- `stopSequences: string[]`: Stop sequences. Generation stops when any sequence is produced.
|
|
33
|
+
|
|
34
|
+
## Tool Loop Control
|
|
35
|
+
|
|
36
|
+
- `maxSteps: integer`: Default: `10` - Maximum number of tool loop iterations. Each step is one model call plus any tool executions. Set lower to limit cost, higher for complex multi-step tasks.
|
|
37
|
+
- `toolChoice`: Default: `'auto'` - Controls how the model uses tools:
|
|
38
|
+
- `'auto'` — The model decides whether to use a tool.
|
|
39
|
+
- `'required'` — The model must use a tool.
|
|
40
|
+
- `'none'` — The model cannot use tools.
|
|
41
|
+
- `{ type: 'tool', toolName: 'name' }` — Force a specific tool.
|
|
42
|
+
- `activeTools: string[]`: Restrict which tools are available to the model. Only tools in this list are offered.
|
|
43
|
+
- `stopOnToolCall: string | string[]`: Stop the tool loop when a specific tool is called. The tool result goes to the client, not back to the model. Useful for tools that return structured data to the UI.
|
|
44
|
+
- `repairToolCall: boolean`: Default: `false` - When `true`, invalid tool inputs are sent back to the model for self-correction instead of failing.
|
|
45
|
+
|
|
46
|
+
###### Return structured data to the UI:
|
|
47
|
+
```yaml
|
|
48
|
+
properties:
|
|
49
|
+
model: claude-sonnet-4-20250514
|
|
50
|
+
stopOnToolCall: get-product-recommendations
|
|
51
|
+
instructions: |
|
|
52
|
+
When the user asks for recommendations, call the
|
|
53
|
+
get-product-recommendations tool. The results will
|
|
54
|
+
be displayed as a product grid in the UI.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Context Pruning
|
|
58
|
+
|
|
59
|
+
Long conversations can exceed a model's context window. The `prune` property strips older messages to reduce context size while keeping recent messages intact.
|
|
60
|
+
|
|
61
|
+
- `prune: object`:
|
|
62
|
+
- `reasoning: string`: How to handle reasoning/thinking content from the model:
|
|
63
|
+
- `'all'` — Remove all reasoning content.
|
|
64
|
+
- `'before-last-message'` — Keep only the last message's reasoning.
|
|
65
|
+
- `'none'` — Keep all reasoning.
|
|
66
|
+
- `toolCalls: string | array`: How to handle tool call and result content.
|
|
67
|
+
- As a string: `'all'`, `'before-last-message'`, `'before-last-N-messages'`, or `'none'`.
|
|
68
|
+
- As an array of per-tool rules. Each rule: `{ type: string, tools?: string[] }`. Rules without `tools` apply to all unmatched tools.
|
|
69
|
+
- `emptyMessages: string`: Default: `'keep'` - Whether to `'keep'` or `'remove'` messages that become empty after pruning.
|
|
70
|
+
|
|
71
|
+
###### Strip all old reasoning and tool results:
|
|
72
|
+
```yaml
|
|
73
|
+
properties:
|
|
74
|
+
model: claude-sonnet-4-20250514
|
|
75
|
+
prune:
|
|
76
|
+
reasoning: before-last-message
|
|
77
|
+
toolCalls: all
|
|
78
|
+
emptyMessages: remove
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
###### Keep search results but prune other tool calls:
|
|
82
|
+
```yaml
|
|
83
|
+
properties:
|
|
84
|
+
model: claude-sonnet-4-20250514
|
|
85
|
+
prune:
|
|
86
|
+
toolCalls:
|
|
87
|
+
- type: before-last-message
|
|
88
|
+
tools:
|
|
89
|
+
- search-products
|
|
90
|
+
- type: all
|
|
91
|
+
emptyMessages: remove
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Per-Step Configuration
|
|
95
|
+
|
|
96
|
+
The `prepareStep` property overrides agent settings for specific steps in the tool loop. Each rule specifies which steps it applies to and what to override. The first matching rule wins.
|
|
97
|
+
|
|
98
|
+
- `prepareStep: array`: Array of step rules. Each rule:
|
|
99
|
+
- `steps: integer[]`: Specific step numbers this rule applies to.
|
|
100
|
+
- `from: integer`: Start of step range (inclusive).
|
|
101
|
+
- `to: integer`: End of step range (inclusive). Omit for open-ended.
|
|
102
|
+
- `activeTools: string[]`: Override available tools.
|
|
103
|
+
- `toolChoice`: Override tool choice.
|
|
104
|
+
- `maxOutputTokens: integer`: Override max output tokens.
|
|
105
|
+
- `temperature: number`: Override temperature.
|
|
106
|
+
|
|
107
|
+
Use either `steps` for specific steps or `from`/`to` for ranges — not both on the same rule.
|
|
108
|
+
|
|
109
|
+
###### Force an initial search, then let the model decide:
|
|
110
|
+
```yaml
|
|
111
|
+
properties:
|
|
112
|
+
model: claude-sonnet-4-20250514
|
|
113
|
+
prepareStep:
|
|
114
|
+
- steps: [1]
|
|
115
|
+
toolChoice: required
|
|
116
|
+
activeTools:
|
|
117
|
+
- search-knowledge-base
|
|
118
|
+
- from: 2
|
|
119
|
+
toolChoice: auto
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
###### Structured first step, creative follow-up:
|
|
123
|
+
```yaml
|
|
124
|
+
properties:
|
|
125
|
+
model: claude-sonnet-4-20250514
|
|
126
|
+
temperature: 0.7
|
|
127
|
+
prepareStep:
|
|
128
|
+
- steps: [1]
|
|
129
|
+
toolChoice: required
|
|
130
|
+
temperature: 0
|
|
131
|
+
activeTools:
|
|
132
|
+
- classify-intent
|
|
133
|
+
- from: 2
|
|
134
|
+
toolChoice: auto
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## File System Access
|
|
138
|
+
|
|
139
|
+
The `fileSystem` property gives the agent scoped, read-only file access. This automatically adds four tools: `read-file`, `list-files`, `search-files`, and `stat-file`. The agent cannot read files outside the specified directory.
|
|
140
|
+
|
|
141
|
+
- `fileSystem: object`:
|
|
142
|
+
- `basePath: string`: __Required__ - Directory to expose. Relative paths are resolved from the app root.
|
|
143
|
+
|
|
144
|
+
###### Documentation assistant with file access:
|
|
145
|
+
```yaml
|
|
146
|
+
properties:
|
|
147
|
+
model: claude-sonnet-4-20250514
|
|
148
|
+
fileSystem:
|
|
149
|
+
basePath: ./docs
|
|
150
|
+
instructions: |
|
|
151
|
+
You are a documentation assistant. Use the file system tools
|
|
152
|
+
to search and read documentation files, then answer the
|
|
153
|
+
user's question based on what you find.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Timeouts and Retries
|
|
157
|
+
|
|
158
|
+
- `maxRetries: integer`: Default: `2` - Maximum retries on provider errors. Set to `0` to disable.
|
|
159
|
+
- `timeout: number | object`: Timeout configuration.
|
|
160
|
+
- As a number: total timeout in milliseconds.
|
|
161
|
+
- As an object with granular control:
|
|
162
|
+
- `totalMs: number`: Total timeout across all steps.
|
|
163
|
+
- `stepMs: number`: Timeout per step.
|
|
164
|
+
- `chunkMs: number`: Timeout between stream chunks.
|
|
165
|
+
|
|
166
|
+
## Provider-Specific Properties
|
|
167
|
+
|
|
168
|
+
- `providerOptions: object`: Pass provider-specific options directly to the AI SDK. Use this for options not covered by the properties above.
|
|
169
|
+
|
|
170
|
+
Each agent type also has its own properties. See the connection pages for details:
|
|
171
|
+
|
|
172
|
+
- [Anthropic](/Anthropic) — `ClaudeAgent` with `thinking` and `effort`
|
|
173
|
+
- [OpenAI](/OpenAI-connection) — `OpenAIAgent` with `reasoningEffort` and `reasoningSummary`
|
|
174
|
+
- [Google](/Google) — `GeminiAgent` with `thinkingConfig` and `safetySettings`
|