Create a function (what the bot does by itself)
dosai_create_functionGive the DOS AI bot a new ability that it then uses by itself in its own conversations with clients; you never run it. Two ways. (1) Ready template: pass template_id from dosai_list_function_templates and its config, e.g. calendar_id for booking or spreadsheet_id for a Google Sheet (the owner first shares it with the bot's Google address; check with dosai_check_google_access). (2) Own integration: pass name, description (when the bot should call it), webhook_url (https) and parameters. This call sends nothing anywhere: it saves the function, and later, when the bot decides to use it in a conversation, the platform POSTs the arguments as JSON to that address. Because client data will go there, this way takes two steps (the owner confirms the address). A service that needs GET is switched by the owner in the cabinet (dosai_get_cabinet_link, place=functions). The function is on at once: verify with dosai_test_bot, a dry run whose tool_calls show which function the bot called and what would have happened. A secret in config (a Telegram bot key) passes through this chat, warn the owner. Requires editor role.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>"
},
"name": "dosai_create_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Latin snake_case. Default: the template's name; required for an own integration. Two functions cannot share a name. | |
| config | No | Template settings by key, as listed in dosai_list_function_templates. | |
| headers | No | Own integration only, e.g. an Authorization header. | |
| parameters | No | Own integration only: what the bot takes from the conversation and sends. | |
| project_id | Yes | From dosai_list_projects. | |
| description | No | When the bot should call it, in plain words. Default: the template's text. | |
| template_id | No | ||
| webhook_url | No | Own integration only: the https address that receives the call. | |
| confirm_token | No | Leave empty on the first call: it changes nothing and returns what will happen and a code. Ask the owner; only after their explicit "yes" call again with the same arguments and this code. |