assistant_listread
List all AI assistants for the user, with defaults per channel highlighted. Each entry includes prompt size (chars + tokens), its own token_limit, tokens_remaining and an over_token_limit flag. The cap is per assistant (assistants.prompt_token_limit): the limit of an assistant is ALWAYS its own token_limit, and instructions_tokens is the real size of its current prompt. new_assistant_token_limit at the top level is only the limit a NEW assistant created from scratch on this account starts with (20,000 on a BYOK agency and its client workspaces, 12,000 otherwise; a duplicate or an agency copy keeps a higher source limit; null when it could not be read). It is never the limit of an existing assistant, so do not report it as one.
assistant_getread
Get an assistant by id with full instructions, model, integration flags, and prompt token usage: instructions_tokens is the real token count of the current prompt and token_limit is the limit of this assistant (plus tokens_remaining and over_token_limit). Use the token fields before editing to stay under the cap, and quote these two numbers, never a generic default.
assistant_createwrite
Create a new AI assistant with a name, system prompt, and model. The response carries `live_on`: the connected channels where the AI will start answering immediately with this assistant (first assistant = fallback default everywhere). Read it and warn the user; use ai.set_channel to keep a channel off until the setup is ready.
assistant_updatewrite
Update assistant fields (name, model, integration flags). Pass ONLY the fields you want to change and OMIT the others: there is no "keep" sentinel, a placeholder such as "__KEEP__" or "unchanged" is refused. To change the system prompt use assistant.ai_edit_prompt (precise edits, version history); `instructions` here is a full replacement, and one that shrinks the prompt below 20% of its current size is refused unless confirm_replace=true.
assistant_deletewrite
Delete an assistant. Pass confirm=true.
assistant_duplicatewrite
Duplicate an assistant (new unique id; copies name, instructions, model and the booking / integration settings). Knowledge files are NOT copied: the copy starts with no files, like the Duplicate button of the app. Upload them to the copy with assistant_add_knowledge_file; the copy gets its own knowledge base on its first upload.
assistant_set_defaultwrite
Set an assistant as the default for a channel (whatsapp, instagram, messenger). The response carries `ai_status` for that channel and `live_on`: if the channel AI is on, this assistant answers there immediately. Warn the user.
assistant_get_defaultsread
Return which assistant is default for each channel.
assistant_ai_edit_promptwrite
THE ONLY way to edit an assistant's system prompt. Takes a natural-language edit request ("change the tone to tutoiement", "add a qualification criterion about budget", "add an audio message at step 2", "pause the AI at step 5", "hand the conversation over to me when a prospect asks something off-script", "fix this typo: replace X with Y", etc.) and applies precise, minimal search/replace operations to the existing prompt: it never blindly overwrites. Knows the SetSmart prompt structure (IDENTITY, CONTEXT, SCRIPT, QUALIFICATION, STRICT RULES), the Calendly / GoHighLevel / iClosed booking function conventions, the audio library (audio_id slugs), and the json_step/tag system, including handoffs to a human (tag handoff + json_step off, with or without a holding message). Enables on this assistant the library audios / images the edited script references and that were not enabled yet: `audios_auto_enabled` / `images_auto_enabled` count only those newly enabled ones (0 = no media was newly enabled, say nothing about audios or images being enabled; above 0, relay `media_auto_enabled_hint`). NOT the tool for follow-ups / relances / reminders ("relancer après 4h", "envoyer un message de rappel", "if they don't reply, send..."): follow-ups never read the prompt, so configure them with followup.set_short / followup.set_long (type "ai" + prompt) and tell the user they live on https://setsmart.io/app/follow-up. If a follow-up request still reaches this tool, it is redirected to the follow-up settings (client_config) instead of the prompt and reported back as followUpApplied. It will NEVER turn a follow-up off: those toggles are account-wide, so use followup.set_short / followup.set_long for an explicit account-wide disable, and ai.end_conversation_followups to stop follow-ups for a single prospect. If the user pastes a complete new prompt and asks to replace everything, call this tool with `use_pasted_prompt: true` (only when the pasted text is itself a complete prompt for the AI setter: never for a pasted conversation, transcript or notes, which are context for an edit_request): the text is read from the conversation itself. NEVER re-type the pasted prompt into `edit_request` (it overflows the output limit and the call is cut). To apply it as-is, pass NO edit_request at all (an edit_request is only for a change to make on top of the pasted text). For big global condensations/optimizations ("condense the whole prompt", "shorten everything"), the editor is bounded to ONE partial pass per call (10-15 operations max): split the work into several calls, one section at a time, until done. To apply a change you already validated with assistant_replay_conversations, pass the same list as `operations` (no edit_request): it is written exactly as replayed, no AI rewrite, versioned like any edit. `assistant_id` is OPTIONAL: when the user only has one assistant, it is auto-selected; when there are multiple, you must pass the target id (use assistant.list or assistant.get_defaults first).
assistant_configure_calendlywrite
Configure Calendly booking on an assistant.
assistant_configure_ghlwrite
Configure GoHighLevel calendar booking on an assistant.
assistant_configure_iclosedwrite
Configure iClosed booking on an assistant.
assistant_configure_calcomwrite
Configure Cal.com booking on an assistant.
assistant_analyze_personaread
Trigger persona analysis using the last 150 answered conversations (uses OpenAI). Returns structured audience profile and token cost.
assistant_scrape_sourceswrite
Step 2 of the assistant wizard: scrape websites with Firecrawl to extract business details (businessName, mainOffer, targetAudience, tone...). Returns a combined scraped_data object to feed into assistant_generate_business_details. Booking links found in the page HTML (Calendly, Cal.com, iClosed, GoHighLevel..., including calendars embedded in an iframe that never appear in the text) come back in booking_links (max 3, best first). They come from a web page: propose one to the user with its full URL, and use it as ctaLink only after their explicit yes. instagram_handle (public profile read: bio, link in bio, latest captions) is a beta reserved to white-label workspaces only; anywhere else it is silently ignored. When it applies, `instagramStatus` is `ok`, `private` (bio only) or an error code (`not_found`, `invalid`, `timeout`, `unavailable`) that never fails the other sources. Skip this if the user has no online presence.
assistant_transcribe_youtubewrite
Transcribe a YouTube video (via Apify) to use as assistant knowledge context. Returns the transcript. Merge the output into the scraped_data.youtubeTranscripts array before passing to assistant_generate_business_details.
assistant_fetch_instagram_profileread
Fetch the connected user's Instagram profile (bio, website, followers) via Meta Graph. Call it first in every assistant creation, no permission needed; also use it when the user asks to read their Instagram.
assistant_generate_business_detailswrite
Step 3 of the wizard: from scraped_data + niche, generate a structured business pack (businessName, businessDescription, mainOffer, targetAudience, knowledge). Uses Claude. Pass the scraped_data returned by assistant_scrape_sources as-is (its structured fields are enough, rawContent is optional; transcripts from assistant_transcribe_youtube can be added under youtubeTranscripts). Plain text about the business is also accepted in scraped_content.
assistant_generate_scriptwrite
Step 5 of the wizard: generate a complete conversation script (array of steps with goal/message/trigger/impact) from the full business + platform + qualification context. Uses streaming Claude. Returns the final script[] ready for review or edit_script_ai. All fields are optional but the richer the context, the better the script. `platform` accepts "instagram", "whatsapp", "messenger", "both" (Instagram + WhatsApp), "all", or an array of channels; the generator writes for one channel, so multi-channel requests use Instagram as the primary. Pass the same channels to assistant_create_from_form.platforms.
assistant_edit_script_aiwrite
Refine a script generated by assistant_generate_script using natural-language instructions ("add a pricing step before the CTA", "make step 2 shorter", "change qualification criteria", "hand the conversation over to me when a prospect asks a medical question": a handoff step with tag handoff + json_step off). Uses streaming Claude. Returns the updated script + a summary of what changed.
assistant_create_from_formwrite
Step 7 (final) of the wizard: create a new AI assistant from the full form data. This mints an OpenAI-style asst_xxx id in the database, builds the full system prompt, creates a vector store if files are attached, and appends the new assistant to client_config.assistant_list. Channels: pass `platforms` (array, e.g. ["instagram"] or ["whatsapp","instagram"]) or `platform` ("instagram", "both" for Instagram + WhatsApp, "all"); the two are merged. `set_as_default_for` takes one channel or several ("both", ["instagram","whatsapp"]). Also accepts `role` as an alias of `setterRole`, and `name` as an alias of `businessName`. Returns the new assistant_id and test_url (the in-app Test page). Files (RAG) are not yet supported via MCP: users add them in the Files card of the assistant page (the next_step field of the result carries the exact link). Guards: refuses (ok:false, nothing created) when ctaLink is not a real URL (placeholders like example.com are refused) and no calendar is connected, unless handoffWithoutLink=true, and when an assistant was created on this account in the last hours unless confirm_new=true (propose updating the existing one with assistant_ai_edit_prompt instead). A connected calendar (Calendly / iClosed / Cal.com / GoHighLevel) switches AI booking on automatically when no booking flag is passed. If the user pasted a complete prompt, pass it as `instructions`: it is stored as-is (no template), and script / businessDescription / mainOffer / ctaLink become optional.
assistant_test_replywrite
Sandbox test of an EXISTING assistant: send one simulated prospect message and get the reply the AI would give (you play the prospect). Nothing is sent to anyone and calendar bookings are simulated. It counts on the plan, so it NEVER runs on your own initiative. Quote, then confirm: a call without the `quote_id` of a live quote runs nothing and returns a `quote` with its `quote_id`: how many simulated replies can run now and what they cost in messages of the plan (half a message each; `metered` false = not counted on this plan, null = the plan could not be read). Propose it to the user in one short sentence with that cost, end your turn, and wait for an explicit yes. Only then call again with that `quote_id` and `confirmed: true`. The server enforces the quote: it covers this assistant only, for 15 minutes, up to the quoted number of replies (do not ask again before each reply); once it is used up or expired the tool runs nothing and returns a NEW quote to propose. In the SetSmart in-app chat a quote cannot be confirmed in the turn that created it. Each result says what it counted in `counted_messages` and what the quote still covers. A workspace is limited to 300 simulated replies per UTC day (in-app Tester, this tool and replays together). A result with `refused: true` (daily limit reached, plan close to its limit, subscription not active, consent ledger unavailable) means nothing was run and is final: do not call again, tell the user what `reason` says. Pass the previous simulated turns in `history` to continue the exchange. A voice note shows in reply_parts as `[voice note "slug"] transcript`: in `history`, pass only its transcript as the ai text, never the bracket label.
assistant_list_filesread
List files attached to an assistant's vector store (knowledge base).
assistant_add_knowledge_filewrite
Add a document to an assistant's knowledge base (the "Files" card of the assistant page: OpenAI file search, plus the index Claude assistants search). Give EXACTLY ONE source: `content` + `filename` (the document text you already have, e.g. an FAQ or a price list the user pasted; .txt by default, .md / .json / .html kept), `url` (a PUBLIC https link to a PDF, Word .docx/.doc, PowerPoint .pptx, .txt or .md file: private, local or non-https links are refused), or `attachment_id` (in-app chat only: a document the user attached, from the [Attachment: ... kind="knowledge file"] or kind="text document" tag). Supported types: .c, .cpp, .cs, .css, .doc, .docx, .go, .html, .java, .js, .json, .md, .pdf, .php, .pptx, .py, .rb, .sh, .tex, .ts, .txt. Limits: 25 MB per file (2 MB for `content`). If the account has several assistants and the user did not say which one, ask (assistant_list) before calling. The file is parsed in the background (usually under a minute): say it was added and give files_page_url. Remove one with assistant_remove_file.
assistant_remove_filewrite
Remove a file from an assistant's knowledge base: detaches it from the assistant's vector store, deletes its chunks from the index Claude assistants search, and DELETES the underlying OpenAI File (it cannot be restored; re-upload it to use it again). Delegates to /api/remove-file-from-assistant.
assistant_replay_conversationswrite
It counts on the plan, so it NEVER runs on your own initiative. Quote, then confirm: a call without the `quote_id` of a live quote runs nothing and returns a `quote` with its `quote_id`: the lead turns that can run now, the prompts run, the simulated replies (lead turns x prompts) and their cost in messages of the plan (half a message each; `metered` false = not counted on this plan, null = the plan could not be read). Propose the replay to the user in one short sentence with that cost, end your turn, and wait for an explicit yes; only then call again with the SAME arguments plus the `pass_back` values of the quote: its `assistant_id` and `conversation_ids` (the conversations it selected, so the selection cannot move when a lead writes), that `quote_id` and `confirmed: true`. The server enforces the quote: it covers this exact replay (same assistant, candidate, run_current, conversations, lead turns asked and scenarios) once, for 15 minutes, up to the quoted number of replies. A lead writing in one of those conversations meanwhile does not change it. Another round (an adjusted candidate, the rest of a replay cut short) needs a new quote and a new yes. If the user declines, apply the change without replay and say it was not tested. Each simulated reply also counts in the 300 simulated replies a workspace may run per UTC day (in-app Tester and assistant_test_reply included); the result says what was counted in `counted_messages`, and a replay cut short only counts the replies it produced. What it does: checks a prompt change BEFORE applying it: replays real conversations of the assistant (and up to 3 short made-up scenarios) through its real pipeline (same model, knowledge, audios, calendars; bookings simulated, nothing sent, no conversation touched), once with the CURRENT prompt and once with a CANDIDATE, and returns both replies side by side for every lead turn, with what was really answered for reference. Candidate: `candidate_operations` (RECOMMENDED: exact edits on the current prompt, the format of assistant_ai_edit_prompt; when they win, apply the very same list with assistant_ai_edit_prompt { operations }), or `candidate_instructions` (a full prompt), or `candidate_assistant_id` (a draft assistant of the same workspace: only its prompt is used). Without a candidate, only the current prompt is replayed (to find where the behaviour happens). Conversations: `conversation_ids` (best: the 2-5 threads where the problem happened, from conversation_search / conversation_list), else `keyword` (threads whose messages contain it), else the most recent threads of the assistant. `history_mode` "simulated" (default) lets each prompt continue its own thread on the real lead messages; "real" answers each lead turn on the real thread up to that point (a clean A/B at a precise moment; use from_turn to reach a late moment). Time: one call answers within ~45 s (MCP clients cut a call at 60 s). The default (2 conversations x 4 lead turns, plus 2 scenarios of up to 4 prospect messages) fits; ask for more threads or turns only explicitly, and split a bigger check across several calls (a few conversation_ids per call, from_turn for a late moment). Turns that would not fit are left out and reported in `stopped`. Hard limits per call: 5 conversations x 8 lead turns, 3 scenarios x 6 turns, 800,000 tokens; per UTC day 4,000,000 tokens per workspace and 8,000,000 per agency (all its client workspaces together). When iterating on a candidate, pass run_current: false (the current replies do not change) to halve the cost.