Docs
ojigi has no admin UI. Your personal agent (PA) manages everything through one MCP server. AI readers: the same content is at /llms.txt.
Getting started
- Sign in with Google at /account. A workspace and an MCP token are created for you automatically (the token is shown once; you can regenerate it any time).
- Copy the setup prompt from /account (it already contains your MCP URL and token) and paste it into your personal agent (Grok Bot, Claude, Cursor, ChatGPT via API, …).
- Your agent connects the MCP server, asks you a few questions about your business, creates and tests the customer-service agent, and sends you the public chat link /a/<slug>.
- From then on, just talk to your agent: review chats that need you, correct answers, run evals, check metrics (FCR) and voice of customer.
The setup prompt
Signed-in owners get this on /account with their MCP URL and token already filled in. Token-free version (replace <YOUR_PA_DESK_TOKEN>):
You are my personal agent. Please set up a customer-service chat agent for my business using ojigi, and manage it for me from now on. ojigi has no admin UI: you are the admin, through its MCP server. STEP 1 — Connect the ojigi MCP server (remote, Streamable HTTP) - Name: ojigi - URL: https://pa-desk-chi.vercel.app/api/mcp - Header: Authorization: Bearer <YOUR_PA_DESK_TOKEN> If you can add MCP servers / custom connectors yourself, do it now. If you can't, show me exactly what to paste into your settings (config JSON or command for the app I'm using), wait until I confirm, then continue. Treat the token like a password: never post it publicly or put it into the agent's knowledge. (I'll replace <YOUR_PA_DESK_TOKEN> with my token from https://pa-desk-chi.vercel.app/account.) STEP 2 — Check the connection Call get_overview and tell me in one line that you're connected. STEP 3 — Interview me (one short message, max 6 questions, in my language) 1. Business name, what we sell / do, website. 2. Who the customers are and the questions they ask most. 3. Tone and language(s) for replies (e.g. polite Japanese + English). 4. Facts it must know: opening hours, prices, shipping/delivery, returns/refunds, payment methods, contact info. 5. When to hand over to a human (topics or keywords, e.g. "refund", "complaint", "lawyer"). 6. Documents I can share: FAQ text, PDFs (attach them) or URLs. If I'm unsure about something, propose a sensible default and move on. STEP 4 — Build it - create_agent with a clear name, instructions that reflect my answers (role, tone, language, what NOT to promise), handoff rules / escalation keywords, publish: true. - add_knowledge with everything I told you plus my files/URLs (one item per topic; PDFs as base64 or URL). - test_ask with 3–5 realistic customer questions (include one that should be handed off). Fix gaps with update_agent / add_knowledge. - add_eval_cases for those questions (with expected answers) and run_evals. Show me the pass rate. STEP 5 — Deliver Give me the public chat link (https://pa-desk-chi.vercel.app/a/<slug>) and a short message I can send customers. Then offer the website chat bubble: ask which platform my site uses (plain HTML, WordPress, Shopify, Next.js/React, Google Tag Manager…), call get_widget_snippet and give me the one-line snippet with only the matching install steps. Ask for my site's domain and lock the widget to it with update_widget_settings allowedDomains. Escalation emails go to my login email by default. Ask if anyone else should get them, or only at certain times / one person at a time, and set that up with upsert_notification_rule (check with test_notification). The email has a private link to reply to that customer right away; if email isn't set up yet, get_escalation_link gives me the link directly. STEP 6 — Tell me what you can do next (briefly), and offer to do it regularly: - get_review_queue: handoffs and low-confidence answers that need me; mark_handled when done. - give_feedback: turn my corrections into fixes + eval cases; run_evals after every change. - get_metrics: conversations, resolution rate, escalation rate, FCR. - analyze_topics: what customers ask most and which knowledge is missing. - get_voc: complaints, sentiment and trends (with chart data). - update_widget_settings: change the website bubble's color, greeting, position or allowed domains. Docs for you: https://pa-desk-chi.vercel.app/llms.txt
Connect manually
- Endpoint
https://pa-desk-chi.vercel.app/api/mcp- Transport
- Streamable HTTP (stateless, JSON responses)
- Auth
Authorization: Bearer pad_…(from /account)
Grok Bot
Easiest: paste the setup prompt above into Grok Bot and it connects itself. Manual: add a custom MCP connector with these values.
Name: ojigi URL: https://pa-desk-chi.vercel.app/api/mcp Header: Authorization: Bearer <YOUR_PA_DESK_TOKEN>
Cursor
Settings → MCP → Add custom MCP, or put this in ~/.cursor/mcp.json (or .cursor/mcp.json in a project).
{
"mcpServers": {
"ojigi": {
"url": "https://pa-desk-chi.vercel.app/api/mcp",
"headers": {
"Authorization": "Bearer <YOUR_PA_DESK_TOKEN>"
}
}
}
}Claude Code
Run once in your terminal (add --scope user to use it in every project).
claude mcp add --transport http ojigi https://pa-desk-chi.vercel.app/api/mcp \ --header "Authorization: Bearer <YOUR_PA_DESK_TOKEN>"
Claude Desktop
Settings → Developer → Edit Config (claude_desktop_config.json), then restart Claude. Uses the mcp-remote bridge (needs Node.js).
{
"mcpServers": {
"ojigi": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://pa-desk-chi.vercel.app/api/mcp",
"--header",
"Authorization:${PA_DESK_AUTH}"
],
"env": {
"PA_DESK_AUTH": "Bearer <YOUR_PA_DESK_TOKEN>"
}
}
}
}ChatGPT / OpenAI
OpenAI Responses API (Agents SDK works the same way). ChatGPT's in-app connectors currently expect OAuth, so use the API or another PA that supports a Bearer header.
{
"model": "gpt-5",
"tools": [
{
"type": "mcp",
"server_label": "ojigi",
"server_url": "https://pa-desk-chi.vercel.app/api/mcp",
"headers": {
"Authorization": "Bearer <YOUR_PA_DESK_TOKEN>"
},
"require_approval": "never"
}
],
"input": "Use ojigi to set up a customer-service agent for my business."
}Any MCP client (HTTP)
Streamable HTTP, stateless, JSON responses. Send JSON-RPC to the endpoint with these headers.
curl -s https://pa-desk-chi.vercel.app/api/mcp \
-H "Authorization: Bearer <YOUR_PA_DESK_TOKEN>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Website widget
Every published agent can also live on the owner's own website as a floating chat bubble (bottom-right). One script tag, no framework; the chat runs in an isolated iframe so the site's CSS can't break it, it goes full-screen on phones, and conversations survive page reloads.
<script src="https://pa-desk-chi.vercel.app/widget.js" data-agent="<agent-slug>" async></script>
- Ask your personal agent: “Put the support bot on my website” — it calls get_widget_snippet and gives you the snippet plus install steps for your platform (HTML, WordPress, Shopify, Next.js/React, Google Tag Manager).
- Paste the snippet before </body> on your site.
- Lock it to your domain: “Only allow the widget on myshop.com” → update_widget_settings allowedDomains. Other sites then can't frame the chat (CSP frame-ancestors) or call it.
- Unpublished agents and disabled widgets render nothing. JavaScript API: window.ojigi.open() / close() / toggle() (window.PADesk also works).
data-agent— required — the agent slugdata-position— "right" (default) or "left"data-color— accent color, e.g. "#e11d48"data-greeting— first message in the paneldata-lang— "ja" | "en" | "auto"data-open— "true" = open on page load (desktop)data-label— text next to the bubble, e.g. "Chat with us"
Concepts
- Agent — one public chat page at
https://pa-desk-chi.vercel.app/a/<slug>. Versioned: every change is a revision you can roll back. - Knowledge modes —
strict: answers only from your documents, otherwise hands off.assist: documents preferred.off: no documents (role-play, coaching, interview practice). - Handoff — when knowledge is missing, an escalation rule applies, or the customer asks for a person, the conversation is marked escalated and shows up in the review queue.
- AI-native improvement — your PA reads conversations, fixes knowledge and prompts, writes eval cases and runs them. You are asked only for what needs human judgment (
get_review_queue), and your corrections become regression tests. - FCR — FCR (first-contact resolution) = share of CLOSED conversations that (1) were never handed off to a human and (2) the same customer (visitorId) did not start another conversation with this agent within 24h after the conversation's last message. A conversation is CLOSED when it was escalated, the customer clicked 'solved', or it has been idle for CONVERSATION_IDLE_MINUTES (default 30). Closed conversations whose 24h window has not elapsed yet count as provisional FCR (reported separately as fcrProvisional).
MCP tools (36)
get_overviewread-only“What agents do I have? Is everything working?”
Start here. Returns the workspace, every agent (id, slug, public URL, published, version), knowledge/conversation counts for the last 7 days, and which LLM provider is active ("mock" means no real model key is configured, answers are deterministic placeholders).
create_agent“Make me an interview-practice agent and send me the public URL.”
Create a new customer-facing chat agent and (by default) publish it. Returns the public chat URL to share. Write a complete systemPrompt yourself from the owner's intent — the owner should not have to. For knowledge-based support bots use knowledgeMode=strict and then add_knowledge; for role-play/coaching agents use knowledgeMode=off.
name: string — Display name shown on the chat pagedescription?: string — One-line purpose, shown under the name on the chat pagesystemPrompt?: string — Role and behavior instructions for the agent (the main prompt)tone?: string — e.g. "friendly, concise" or "polite keigo"language?: string — "auto" (reply in the customer's language), "ja", "en", ...greeting?: string — First message shown on the chat pageknowledgeMode?: "strict" | "assist" | "off" — strict = answer only from knowledge, hand off otherwise (support bots). assist = prefer knowledge, general chat allowed. off = no knowledge retrieval (role-play agents like interview practice).escalationRules?: string — Natural-language rules for when to hand off to a human (e.g. 'refund requests over ¥10,000', 'legal threats')escalationKeywords?: string[] — Customer phrases that trigger an immediate handoff, no LLM involvedhandoffMessage?: string — Text shown when handing off. Empty = built-in bilingual defaultuseSharedKnowledge?: boolean — Also answer from the workspace's shared knowledge (docs added with scope=shared). Default true; set false for agents that must only use their own docs.slug?: string — URL slug (a-z, 0-9, -). Omit to auto-generate.publish?: boolean — Make the chat page public immediately (default true)
update_agent“Make it more polite. / Unpublish it. / Undo your last change.”
Change any agent setting (prompt, tone, escalation rules, published flag...). Every change creates a new version with your changeNote, so it can be rolled back with restoreVersion. Only pass fields you want to change. After changing behavior, verify with run_evals.
agent: string — Agent id or slug (see get_overview)name?: string — Display name shown on the chat pagedescription?: string — One-line purpose, shown under the name on the chat pagesystemPrompt?: string — Role and behavior instructions for the agent (the main prompt)tone?: string — e.g. "friendly, concise" or "polite keigo"language?: string — "auto" (reply in the customer's language), "ja", "en", ...greeting?: string — First message shown on the chat pageknowledgeMode?: "strict" | "assist" | "off" — strict = answer only from knowledge, hand off otherwise (support bots). assist = prefer knowledge, general chat allowed. off = no knowledge retrieval (role-play agents like interview practice).escalationRules?: string — Natural-language rules for when to hand off to a human (e.g. 'refund requests over ¥10,000', 'legal threats')escalationKeywords?: string[] — Customer phrases that trigger an immediate handoff, no LLM involvedhandoffMessage?: string — Text shown when handing off. Empty = built-in bilingual defaultuseSharedKnowledge?: boolean — Also answer from the workspace's shared knowledge (docs added with scope=shared). Default true; set false for agents that must only use their own docs.published?: boolean — true = public chat page live, false = hidden (404)restoreVersion?: number — Restore all settings from this earlier version (see get_agent revisions)changeNote?: string — Why you changed it (shown in revision history)
get_widget_snippetread-only“Put this bot on my website. / Give me the code for the chat bubble.”
Returns the copy-paste <script> snippet that adds a floating chat bubble (bottom-right) to the owner's website for this agent, plus step-by-step install instructions for plain HTML, WordPress, Shopify, Next.js, React and Google Tag Manager, optional data-* attributes (position, color, greeting, language, open-by-default, label), current widget settings and warnings (e.g. agent unpublished = widget renders nothing). Offer this to the owner right after publishing an agent; ask which platform their site uses and give only the matching instructions. Conversations from the widget show channel="widget".
agent: string — Agent id or slug (see get_overview)
update_widget_settings“Make the chat bubble pink and only allow it on myshop.com.”
Change the website widget of an agent: enabled, accentColor (hex), greeting (first message in the widget; empty = agent greeting), position (right/left), openByDefault, launcherLabel (text next to the bubble), allowedDomains (sites allowed to embed it; empty list = any site; "shop.com" also allows its subdomains, "*.shop.com" only subdomains, "localhost:8080" for local testing). Domain restriction is enforced by a frame-ancestors CSP on the embed page and an origin check in the chat API. Only pass fields to change. Returns the new settings and snippet.
agent: string — Agent id or slug (see get_overview)enabled?: boolean — false = widget renders nothing (the /a/<slug> page is unaffected)accentColor?: string — Hex color of the bubble and send button, e.g. "#e11d48"greeting?: string — First message shown in the widget. Empty string = use the agent greetingposition?: "right" | "left" — Bottom-right (default) or bottom-leftopenByDefault?: boolean — Open the panel automatically on desktop page loadlauncherLabel?: string — Text next to the bubble icon, e.g. "Chat with us". Empty = icon onlyallowedDomains?: string[] — Websites allowed to embed the widget, e.g. ["myshop.com"]. [] = any site
get_agentread-only“Show me the current prompt of the support bot.”
Full configuration of one agent (system prompt, tone, escalation rules, knowledge mode...), its public URL, knowledge doc count and the last 20 revisions.
agent: string — Agent id or slug (see get_overview)
add_knowledge“Make a support bot; here are 50 PDFs, answer from them. / Every bot should know our opening hours.”
Add up to 50 documents in one call. Each item is ONE of: text (plain text or markdown — preferred: you fetch Notion/Drive/websites yourself and pass clean text), url (public PDF or web page; text is extracted), pdfBase64 (PDF bytes). scope=agent (default) = only this agent; scope=shared = every agent of the workspace (unless it opted out with useSharedKnowledge=false). pinned=true = the doc is ALWAYS put in the agent's prompt (for short core facts: prices, hours, contact, policies; total pinned text per agent is capped, see list_knowledge); otherwise it is retrieved per question (hybrid keyword + semantic search + rerank, ja/en). Documents are chunked and embedded; returns per-item success/failure and embedding status. For more than 50, call repeatedly.
agent?: string — Agent id or slug. Required for scope=agent; omit for scope=sharedscope?: "agent" | "shared"items: { title, text, url, pdfBase64, pinned }[]
list_knowledgeread-only“What documents does the bot know?”
List documents with docId, title, scope (agent/shared), pinned, size, chunks and notEmbedded (chunks still waiting for a vector; keyword search covers them). With agent: what that agent can use (its own docs + shared docs unless it opted out) plus how much of the pinned budget is used. Without agent: every doc in the workspace. (query is kept for compatibility; prefer search_knowledge.)
agent?: string — Agent id or slug; omit for the whole workspacequery?: string — Deprecated: same as search_knowledge
search_knowledgeread-only“Does the bot know about our return policy? / Why did it answer that?”
Run the agent's retrieval for a query and return the chunks it would see: chunkId, docId, doc title, scope, score (0-1; Voyage rerank relevance when available) and per-signal scores (keyword, vector, rerank), plus diagnostics (mode hybrid/keyword, latency, any fallback errors). With agent: that agent's view (pinned docs are excluded here because they are always in the prompt; they are listed separately). Without agent: search the whole workspace including pinned docs — use this before bulk edits to find every place a fact appears. Use mode=keyword to see the plain keyword fallback.
agent?: string — Agent id or slug; omit to search the whole workspacequery: stringlimit?: numbermode?: "hybrid" | "keyword"
update_knowledge“Here is the new price list, replace the old one.”
Replace the full text and/or title of one document (keeps its docId, scope and pinned flag). The doc is re-chunked and re-embedded. For small fixes across many docs use replace_in_knowledge instead. Afterwards run_evals.
docId: stringtext?: stringtitle?: string
replace_in_knowledge“The price changed from ¥5,000 to ¥6,000 everywhere. / We moved, update the address in all docs.”
Find text in every document of an agent (its own + shared) or of the whole workspace (omit agent), and replace it. Default apply=false returns a preview (docs, occurrence counts, before/after snippets) and changes nothing; call again with apply=true to write. Changed docs are re-chunked and re-embedded. Plain text match by default (regex=true for a JavaScript regex; caseSensitive=false for Latin text). Search first with search_knowledge to catch paraphrased variants (e.g. 5千円 / 5,000円 / ¥5000) and replace each. After applying: add_eval_cases for the corrected fact, then run_evals.
agent?: string — Agent id or slug; omit = all docs of the workspacefind: stringreplace: stringregex?: booleancaseSensitive?: booleandocIds?: string[] — Limit to these docsapply?: boolean — false = preview only
set_pinned“Always keep the price list in mind. / Unpin the old FAQ.”
Pinned docs are injected into every prompt of the agents that see them (always available, never missed by search); unpinned docs are retrieved per question. Pin only short, high-priority facts (prices, hours, contact, key policies, current campaigns). Total pinned text per agent is capped at 12000 characters; list_knowledge shows usage and anything truncated.
docIds: string[]pinned: boolean
set_knowledge_scope“Share the company profile with all bots. / Only the support bot should use this doc.”
scope=shared: the docs apply to every agent of the workspace (agents with useSharedKnowledge=false ignore them). scope=agent: the docs belong to one agent (pass agent).
docIds: string[]scope: "agent" | "shared"agent?: string — Required for scope=agent
reindex_knowledge“Finish indexing the documents.”
Computes missing vectors (new or edited chunks that could not be embedded at ingest time, e.g. because of a rate limit). Safe to call repeatedly; returns embedded/pending counts. Keyword search works for pending chunks meanwhile.
delete_knowledge“Remove the old 2023 price list.”
Delete documents (and their chunks) by docId (agent or shared). Get ids from list_knowledge / search_knowledge.
agent?: string — Ignored (kept for compatibility); docIds are workspace-widedocIds: string[]
list_conversationsread-only“Show me recent chats.”
Recent customer conversations, newest first, with status (open/resolved/escalated), first customer question, message count and cached analysis (topic, sentiment) if available. Use get_conversation for the full transcript.
agent?: string — Agent id or slug. Omit to include all agents of this workspace.days?: number — Look-back window in days (default 7)status?: "open" | "resolved" | "escalated"limit?: numberoffset?: number
get_conversationread-only“Show me that chat in full.”
Full transcript of one conversation: every message with its messageId, role, time, and for agent messages the retrieval score / handoff info; plus any owner feedback already given. Use messageIds with give_feedback.
conversationId: string
get_review_queueread-only“Anything that needs my feedback?”
The short list of items that genuinely need HUMAN judgment: unhandled escalations, answers given on weak knowledge, unhappy customers who were not escalated, and failing evals. Fix what you can yourself (knowledge, prompt, evals) and only bring the rest to the owner, with a concrete question.
agent: string — Agent id or slug (see get_overview)days?: number — Look-back window in days (default 7)limit?: number
give_feedback“That answer about shipping was wrong; it's 3-5 days.”
Record the owner's verdict on one agent message (rating good/bad, optional correction). A correction automatically becomes an eval case (question = the customer's message, expected = correction) so the fix is regression-tested. Feedback alone does not change the agent: also add_knowledge or update_agent to fix the cause, then run_evals.
messageId: string — Assistant messageId from get_conversationrating: "good" | "bad"correction?: string — What the agent should have said / the correct factsnote?: stringcreateEvalCase?: boolean — Default: true when a correction is given
mark_handled“I called that customer back, clear it.”
Mark escalated/flagged conversations as dealt with so they leave the review queue. Does not change FCR (an escalation stays an escalation).
conversationIds: string[]
get_notification_settingsread-only“Who gets notified when the bot hands off?”
Effective escalation-email routing: the workspace's notification rules (in evaluation order), each agent's shorthand emails, the workspace owner default, and whether the server can send email. Routing chain per escalation: matching rules (list_notification_rules) → else the agent's notification emails (set_notification_emails) → else the workspace owner's login email. Use test_notification to see exactly who would get a given ticket.
agent?: string — Agent id or slug (see get_overview)
set_notification_emails“Email me and support@myshop.jp when a customer needs a human.”
Shorthand for the common case: the addresses emailed when this agent hands off and no notification rule matches (replaces the list; [] = back to the default, the workspace owner's login email). For conditions, time windows, round-robin or muting use upsert_notification_rule. Each email has the ticket summary, the last messages and a private link to reply live in that ONE conversation (AI pauses; hand back or close there; 24h). If sending isn't configured (get_notification_settings), use get_escalation_link.
agent: string — Agent id or slug (see get_overview)emails: string[]
list_notification_rulesread-only“Show my escalation routing rules.”
All escalation-email rules of the workspace in evaluation order (lower position first). See upsert_notification_rule for the semantics.
upsert_notification_rule“Weekdays 9–18 send refund escalations to one of Sato/Tanaka in turn; nights and weekends email only me; never email about the test bot.”
Create (no id) or replace (with id) one escalation routing rule. Rules are generic building blocks; compose them instead of asking for features: - Evaluation per escalation: enabled rules in ascending position; a rule matches if ALL its conditions hold and the time is inside its schedule. Every matching rule delivers (same address only once) until a matching rule has stop=true. If NO rule matches → the agent's set_notification_emails list → else the workspace owner's login email. - recipients: email addresses and/or "owner" (workspace owners' login emails) / "members" (all members). recipients [] + stop=true = mute (match → send nothing, no fallback), e.g. silence a test agent or nights. - mode: "all" = one email to every recipient (broadcast); "one" = a single recipient, rotating round-robin per ticket. - conditions (all optional; lists match if ANY item matches, case-insensitive substrings): agents (ids or slugs), reasonContains (handoff reason, e.g. "Customer asked for a human", "Matched escalation keyword "返金"", or the model's own reason), messageContains (customer messages), channels ("web" chat page / "widget"). - schedule: {timezone (default Asia/Tokyo), windows: [{days: [0-6, 0=Sun] or ["mon",...], from: "09:00", to: "18:00"}]}; from > to = overnight window; omit/null = always. For "outside hours" add a later rule without schedule (fallback) or with the complementary windows. - Recipe: business hours → team (mode one, stop) at position 10; otherwise → owner at position 20. Verify with test_notification (dry run) before relying on it. There is no digest/batching: each escalation is emailed immediately when a rule matches.
id?: string — Rule id to replace; omit to createname: stringenabled?: booleanposition?: number — Lower runs first (default 100)recipients: string[] — Emails and/or "owner" / "members"; [] = mutemode?: "all" | "one"stop?: boolean — Stop evaluating later rules when this matchesconditions?: { agents, reasonContains, messageContains, channels }schedule?: { timezone, windows }
delete_notification_rule“Remove the night-time rule.”
Delete one notification rule by id (see list_notification_rules).
id: string
test_notification“If a refund request comes in on Saturday night, who gets emailed?”
Evaluate the routing for a hypothetical (or real, via conversationId) escalation without changing anything: per-rule trace (matched / why not), final recipients and which fallback applied. send=true also sends a clearly marked TEST email (no reply link) to those recipients — only do that when the owner asked for it. Round-robin cursors are not advanced.
agent?: string — Required unless conversationId is givenconversationId?: string — Use a real conversation's text/reason/channelreason?: string — Handoff reason, default "Customer asked for a human"message?: string — Customer textchannel?: "web" | "widget"at?: string — ISO time to evaluate at (default now)send?: boolean
get_escalation_link“Give me the link so I can answer that customer myself.”
Issue a private link for ONE conversation (usually an escalated one from get_review_queue / list_conversations). Opening it signs the person in to just that conversation: they can read it, reply to the customer live (the customer sees it in the chat/widget), hand back to the AI, or close it. Valid 24h by default. Treat it like a password: give it only to your user. revokeExisting=true invalidates all earlier links for this conversation (use to regenerate a leaked/expired link).
conversationId: stringttlHours?: number — Default 24revokeExisting?: boolean — Default false
revoke_escalation_links“I forwarded that link by mistake, kill it.”
Invalidate every reply link (emailed or issued) for a conversation. Anyone with an old link sees an 'expired/revoked' page. Issue a fresh one with get_escalation_link if needed.
conversationId: string
test_askread-only“Try asking it about returns.”
Ask the agent exactly as a customer would, without creating a customer conversation (not counted in metrics). Returns the answer, whether it handed off and why, and the knowledge chunks it used. Optional history for multi-turn tests.
agent: string — Agent id or slug (see get_overview)message: stringhistory?: { role, content }[]
add_eval_cases“Make sure it always answers the refund question correctly.”
Add test questions with a reference answer. expectHandoff=true means the correct behavior is handing off to a human (e.g. out-of-scope or sensitive questions). mustInclude lists exact phrases the answer must contain (e.g. a phone number). Generate cases yourself from knowledge, feedback and real conversations.
agent: string — Agent id or slug (see get_overview)cases: { question, expected, mustInclude, expectHandoff }[]
list_eval_casesread-only“What tests do we have?”
All eval cases for an agent with each case's result in the most recent run.
agent: string — Agent id or slug (see get_overview)
delete_eval_cases“That test is outdated, drop it.”
Delete eval cases by id.
agent: string — Agent id or slug (see get_overview)caseIds: string[]
run_evals“Improve the agent and test it yourself.”
Run all (or selected) eval cases against the CURRENT agent version: the agent answers each question, then an LLM judge grades it against the reference (plus exact mustInclude checks). Stores the run and returns pass rate, failures with reasons, and what newly passes/fails versus the previous run. Use after every prompt/knowledge change. LLM calls are rate limited (a few per minute), so cases run one by one; if the result has notRun, call run_evals again with those caseIds.
agent: string — Agent id or slug (see get_overview)caseIds?: string[] — Omit to run all cases (max 100)
analyze_topicsread-only“What gets asked most? What knowledge is missing?”
Classifies recent conversations (cached) and returns topics ranked by volume with escalation/unanswered counts and example questions, plus knowledge gaps: questions the agent could not answer and answers given on weak knowledge. Use the gaps to decide what to add_knowledge.
agent?: string — Agent id or slug. Omit to include all agents of this workspace.days?: number — Look-back window in days (default 7)
get_metricsread-only“What is our FCR lately?”
Volume, resolution rate, escalation rate and FCR (first-contact resolution) for the period and the previous period of equal length, plus a daily series (Asia/Tokyo days). The response includes the exact FCR definition — quote it when reporting.
agent?: string — Agent id or slug. Omit to include all agents of this workspace.days?: number — Look-back window in days (default 7)
get_vocread-only“What are customers complaining about? Chart it.”
Voice-of-customer summary: complaint/pain-point categories with counts and sample quotes, sentiment and intent distribution, and chart-ready series (charts.complaintsByCategory bar, charts.sentiment pie, charts.negativeByDay line) you can render directly.
agent?: string — Agent id or slug. Omit to include all agents of this workspace.days?: number — Look-back window in days (default 7)
Public chat API
The chat page uses this; you can embed it elsewhere too.
POST https://pa-desk-chi.vercel.app/api/chat/<slug>
{ "visitorId": "<8-64 chars, stable per browser>", "conversationId": "<uuid, optional>", "message": { "text": "..." } }
→ AI SDK UI message stream (SSE). First chunk: messageMetadata.conversationId
POST https://pa-desk-chi.vercel.app/api/chat/<slug>/resolve
{ "conversationId": "<uuid>", "visitorId": "..." } // customer says "solved"