Skip to content

The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.

Setup agent over HTTP: instructions in setup_status, short providers_list, assistant ids, first reply when changing (PR 2055)

Janikb119e87cb936
diff --git a/apps/api/src/setup-mcp.ts b/apps/api/src/setup-mcp.ts
index 55136765..ae57b6e3 100644
--- a/apps/api/src/setup-mcp.ts
+++ b/apps/api/src/setup-mcp.ts
@@ -524,6 +524,7 @@ type WorkspaceStatus = {
id: string | null
name: string | null
role?: ManagedWorkspace['role']
+ assistants?: { id: string; name: string }[]
known?: KnownBusiness
steps: Step[]
}
@@ -849,6 +850,12 @@ async function workspaceStatus(actor: Actor, ws: ManagedWorkspace, advance: bool
id: ws.id,
name: ws.name,
role: ws.role,
+ // Its assistants (oldest first: the one calls use first); pass the id as assistantId to assistant_update.
+ assistants: await db
+ .select({ id: assistants.id, name: assistants.name })
+ .from(assistants)
+ .where(eq(assistants.workspace_id, ws.id))
+ .orderBy(asc(assistants.created_at)),
known: await knownBusiness(ws),
steps: inGroup('business', steps, names),
}
@@ -1681,7 +1688,7 @@ export function instructionsBeforeNumber(guide: ForwardingGuide, mode: Forwardin
}
}
-function registerTools(server: McpServer, actor: Actor) {
+function registerTools(server: McpServer, actor: Actor, plainHttp = false) {
const read = { readOnlyHint: true }
const who = personOf(actor)
// A workspace owner's or a partner owner's link: no server tools at all, only the workspace's (agent-setup.ts).
@@ -1702,7 +1709,11 @@ function registerTools(server: McpServer, actor: Actor) {
guard(actor, 'setup_status', async () => {
// The link's agent connected (agent-setup-counts.ts): counted once per link, never in the way of the answer.
await countLinkConnected(actor.setupKeyId)
- return answer(await setupStatus(actor, { advance: !input?.read_only }), actor)
+ const status = await setupStatus(actor, { advance: !input?.read_only })
+ // An agent calling over plain HTTP (the prompt's curl way) never sent initialize, so it never got the server's
+ // instructions: they come with setup_status instead. An MCP client has them already (serveSetupMcp).
+ const instructions = plainHttp ? instructionsFor(actor) : null
+ return answer(instructions ? { instructions, ...status } : status, actor)
}),
)
if (serverTools)
@@ -1710,46 +1721,72 @@ function registerTools(server: McpServer, actor: Actor) {
'providers_list',
{
description:
- 'The providers this install can use, by category (telephony, stt, llm, tts, realtime, email, sign_in, recording, business, apps; billing keys are set only in the app): their fields (name, whether secret, optional), which one is picked, which fields are set (never a value) and help text. Use the field names with provider_setKeys.',
+ 'The providers this install can use, by category (telephony, stt, llm, tts, realtime, email, sign_in, recording, business, apps; billing keys are set only in the app). Without input: a short list, each provider with its category, whether it is picked and whether its required fields are set. With category or provider: the full details for those: their fields (name, whether secret, optional), which fields are set (never a value), help text and, for sign-in and apps, the redirect URIs. Use the field names with provider_setKeys.',
inputSchema: z.object({
category: z
.enum(
[...categoryNames].filter(c => !moneyCategories.includes(c as ProviderCategory)) as [ProviderCategory],
)
.optional(),
+ provider: z.string().optional().describe('One provider id from the short list: only its details'),
}),
annotations: read,
},
- async ({ category }) =>
+ async ({ category, provider }) =>
guard(actor, 'providers_list', async () => {
const status = await providerStatus(db)
- const rows = status.providers
- .filter(p => (!category || p.category === category) && !moneyCategories.includes(p.category))
- .map(p => {
- const spec = providerSpec(p.provider)
- const fieldSpec = (field: string) =>
- (spec.fields as Record<string, { optional?: true; hint?: string }>)[field]
- return {
- provider: p.provider,
- label: p.label,
- category: p.category,
- picked: isMultiCategory(p.category) ? null : status.active[p.category]?.provider === p.provider,
- fields: p.fields.map(f => ({
- field: f.field,
- label: f.label,
- secret: f.secret,
- optional: Boolean(fieldSpec(f.field)?.optional),
- set: Boolean(f.source),
- hint: fieldSpec(f.field)?.hint ?? null,
- })),
- help: providerHelp(p.provider),
- ...(spec.category === 'sign_in' || spec.category === 'apps'
- ? { redirect_uris: redirectUris(p.provider) }
- : {}),
- }
+ const listed = status.providers.filter(
+ p =>
+ (!category || p.category === category) &&
+ (!provider || p.provider === provider) &&
+ !moneyCategories.includes(p.category),
+ )
+ const picked = (p: (typeof listed)[number]) =>
+ isMultiCategory(p.category) ? null : status.active[p.category]?.provider === p.provider
+ // No input: the short list (a few KB, not the whole catalogue with every help text); details on request.
+ if (!category && !provider)
+ return answer({
+ providers: listed.map(p => {
+ const spec = providerSpec(p.provider)
+ const optional = (field: string) =>
+ Boolean((spec.fields as Record<string, { optional?: true }>)[field]?.optional)
+ return {
+ provider: p.provider,
+ label: p.label,
+ category: p.category,
+ picked: picked(p),
+ ready: p.fields.every(f => optional(f.field) || Boolean(f.source)),
+ }
+ }),
+ details: english.t('server.setupAgent.providersList.details'),
})
+ const rows = listed.map(p => {
+ const spec = providerSpec(p.provider)
+ const fieldSpec = (field: string) =>
+ (spec.fields as Record<string, { optional?: true; hint?: string }>)[field]
+ return {
+ provider: p.provider,
+ label: p.label,
+ category: p.category,
+ picked: picked(p),
+ fields: p.fields.map(f => ({
+ field: f.field,
+ label: f.label,
+ secret: f.secret,
+ optional: Boolean(fieldSpec(f.field)?.optional),
+ set: Boolean(f.source),
+ hint: fieldSpec(f.field)?.hint ?? null,
+ })),
+ help: providerHelp(p.provider),
+ ...(spec.category === 'sign_in' || spec.category === 'apps'
+ ? { redirect_uris: redirectUris(p.provider) }
+ : {}),
+ }
+ })
return answer({
- categories: Object.fromEntries(categoryNames.map(c => [c, providerCategoryLabel(c)])),
+ categories: Object.fromEntries(
+ categoryNames.filter(c => rows.some(r => r.category === c)).map(c => [c, providerCategoryLabel(c)]),
+ ),
providers: rows,
})
}),
@@ -2028,22 +2065,29 @@ function registerPartnerAction(server: McpServer, def: ActionDef, actor: Actor,
}
/** The setup tools for this setup key's admin (or, for a workspace key, its owner or admin, by that role). */
-export function setupMcpServerFor(actor: Actor) {
- const instructions = actor.setupPartnerId
+/** The setup MCP's `instructions` for this link: a partner's, a workspace's or the install's playbook. */
+const instructionsFor = (actor: Pick<Actor, 'setupPartnerId' | 'setupWorkspaceId'>) =>
+ actor.setupPartnerId
? setupMcpPartnerInstructions()
: actor.setupWorkspaceId
? SETUP_MCP_WORKSPACE_INSTRUCTIONS
: SETUP_MCP_INSTRUCTIONS
- const server = new McpServer({ name: 'linedesk-setup', version: '1' }, { instructions })
- registerTools(server, actor)
+
+/** `plainHttp`: the request came without MCP-Protocol-Version, so the agent never saw the instructions (serveSetupMcp). */
+export function setupMcpServerFor(actor: Actor, plainHttp = false) {
+ const server = new McpServer({ name: 'linedesk-setup', version: '1' }, { instructions: instructionsFor(actor) })
+ registerTools(server, actor, plainHttp)
return server
}
-const handler = createMcpHandler(ctx => setupMcpServerFor(ctx.authInfo!.extra!.actor as Actor), {
- responseMode: 'json',
- maxRequestBodySize: MCP_MAX_BODY_BYTES,
- onerror: e => console.error(`setup mcp: ${e.message}`),
-})
+const handler = createMcpHandler(
+ ctx => setupMcpServerFor(ctx.authInfo!.extra!.actor as Actor, Boolean(ctx.authInfo!.extra!.plainHttp)),
+ {
+ responseMode: 'json',
+ maxRequestBodySize: MCP_MAX_BODY_BYTES,
+ onerror: e => console.error(`setup mcp: ${e.message}`),
+ },
+)
const challenge = { 'www-authenticate': 'Bearer realm="linedesk-setup", error="invalid_token"' }
const refuse = (status: 400 | 401 | 405 | 413 | 429, error: string, headers: Record<string, string> = {}) =>
@@ -2091,6 +2135,8 @@ export async function serveSetupMcp(request: Request, keyInPath: string | null,
if (method === 'subscriptions/listen') return refuse(400, `${method} is not supported`)
const release = takeSlot(`setup:${actor.setupKeyId}`)
if (!release) return refuse(429, 'at most 4 requests at once per setup key', { 'retry-after': '1' })
+ // An MCP client sends MCP-Protocol-Version on every request after initialize; the prompt's curl calls do not.
+ const plainHttp = !request.headers.get('mcp-protocol-version')
try {
const res = await handler.fetch(request, {
parsedBody: message,
@@ -2098,10 +2144,11 @@ export async function serveSetupMcp(request: Request, keyInPath: string | null,
token: 'setupkey',
clientId: actor.actorId,
scopes: [...actor.permissions],
- extra: { actor },
+ extra: { actor, plainHttp },
},
})
- const body = await res.text()
+ const sent = await res.text()
+ const body = plainHttp ? withoutStructuredCopy(sent) : sent
release()
// Not the SDK's connection headers (keep-alive.ts).
return new Response(body, {
@@ -2114,3 +2161,23 @@ export async function serveSetupMcp(request: Request, keyInPath: string | null,
throw e
}
}
+
+/**
+ * A tool answer carries its JSON twice: as text and as structuredContent (answer). An MCP client reads one of them; an
+ * agent calling over plain HTTP reads the raw body, so it gets the text only, at half the size. Anything that is not
+ * such an answer (an error, initialize, tools/list) passes unchanged, in JSON or as server-sent events.
+ */
+export function withoutStructuredCopy(body: string): string {
+ const strip = (json: string) => {
+ try {
+ const message = JSON.parse(json) as { result?: { content?: unknown[]; structuredContent?: unknown } }
+ if (!message?.result?.structuredContent || !message.result.content?.length) return json
+ delete message.result.structuredContent
+ return JSON.stringify(message)
+ } catch {
+ return json
+ }
+ }
+ if (body.trimStart().startsWith('{')) return strip(body)
+ return body.replace(/^data: (.*)$/gm, (_, json: string) => `data: ${strip(json)}`)
+}
diff --git a/apps/api/test/agent-setup-counts.test.ts b/apps/api/test/agent-setup-counts.test.ts
index 6e8d014d..5c5a7624 100644
--- a/apps/api/test/agent-setup-counts.test.ts
+++ b/apps/api/test/agent-setup-counts.test.ts
@@ -12,7 +12,12 @@ let id = 0
const setupStatus = (key: string) =>
appRequest(`/mcp/setup/${key}`, {
method: 'POST',
- headers: { 'content-type': 'application/json', accept: 'application/json, text/event-stream', [FROM]: randomIp() },
+ headers: {
+ 'content-type': 'application/json',
+ accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
+ [FROM]: randomIp(),
+ },
body: JSON.stringify({
jsonrpc: '2.0',
id: ++id,
diff --git a/apps/api/test/broken-text.test.ts b/apps/api/test/broken-text.test.ts
index 1dc126ad..d4eaae2e 100644
--- a/apps/api/test/broken-text.test.ts
+++ b/apps/api/test/broken-text.test.ts
@@ -33,6 +33,7 @@ async function mcp(path: string, args: Record<string, unknown>, tool: string, he
headers: {
'content-type': 'application/json',
accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
[FROM]: randomIp(),
...headers,
},
diff --git a/apps/api/test/self-serve.test.ts b/apps/api/test/self-serve.test.ts
index db57e853..503631da 100644
--- a/apps/api/test/self-serve.test.ts
+++ b/apps/api/test/self-serve.test.ts
@@ -1370,6 +1370,7 @@ describe("the owner's agent setup link before the trial (agent-first, 2026-11-18
headers: {
'content-type': 'application/json',
accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
[FROM]: randomIp(),
},
body: JSON.stringify({ jsonrpc: '2.0', id: ++rpc, method, params }),
diff --git a/apps/api/test/setup-feedback.test.ts b/apps/api/test/setup-feedback.test.ts
index 08b2e685..3ea9a93f 100644
--- a/apps/api/test/setup-feedback.test.ts
+++ b/apps/api/test/setup-feedback.test.ts
@@ -85,7 +85,12 @@ async function makeKey(who: User, client?: string) {
async function mcp(key: string, method: string, params: Record<string, unknown> = {}) {
const res = await appRequest(`/mcp/setup/${key}`, {
method: 'POST',
- headers: { 'content-type': 'application/json', accept: 'application/json, text/event-stream', [FROM]: randomIp() },
+ headers: {
+ 'content-type': 'application/json',
+ accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
+ [FROM]: randomIp(),
+ },
body: JSON.stringify({ jsonrpc: '2.0', id: ++id, method, params }),
})
const text = await res.text()
diff --git a/apps/api/test/setup-mcp-partner.test.ts b/apps/api/test/setup-mcp-partner.test.ts
index 315ed4f8..302e974f 100644
--- a/apps/api/test/setup-mcp-partner.test.ts
+++ b/apps/api/test/setup-mcp-partner.test.ts
@@ -27,7 +27,12 @@ let id = 0
async function mcp(key: string, method: string, params: Record<string, unknown> = {}) {
const res = await appRequest(`/mcp/setup/${key}`, {
method: 'POST',
- headers: { 'content-type': 'application/json', accept: 'application/json, text/event-stream', [FROM]: randomIp() },
+ headers: {
+ 'content-type': 'application/json',
+ accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
+ [FROM]: randomIp(),
+ },
body: JSON.stringify({ jsonrpc: '2.0', id: ++id, method, params }),
})
const text = await res.text()
diff --git a/apps/api/test/setup-mcp-workspace.test.ts b/apps/api/test/setup-mcp-workspace.test.ts
index fc06b92c..d079d5d6 100644
--- a/apps/api/test/setup-mcp-workspace.test.ts
+++ b/apps/api/test/setup-mcp-workspace.test.ts
@@ -38,7 +38,12 @@ let id = 0
async function mcp(key: string, method: string, params: Record<string, unknown> = {}) {
const res = await appRequest(`/mcp/setup/${key}`, {
method: 'POST',
- headers: { 'content-type': 'application/json', accept: 'application/json, text/event-stream', [FROM]: randomIp() },
+ headers: {
+ 'content-type': 'application/json',
+ accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
+ [FROM]: randomIp(),
+ },
body: JSON.stringify({ jsonrpc: '2.0', id: ++id, method, params }),
})
const text = await res.text()
@@ -546,9 +551,16 @@ describe("an admin's link (settings with an AI agent)", () => {
]
for (const [name, input] of ownerOnly) expect((await runAction(name, input, inside)).status, name).toBe(403)
// Forged further: owner rights and role on the actor. The backstop keeps it to the role the key was made with.
- const forged: Actor = { ...inside, role: 'owner', permissions: [...inside.permissions, 'workspace:own', 'team:write'] }
+ const forged: Actor = {
+ ...inside,
+ role: 'owner',
+ permissions: [...inside.permissions, 'workspace:own', 'team:write'],
+ }
for (const [name, input] of ownerOnly)
- expect(await runAction(name, input, forged), name).toMatchObject({ status: 403, body: { error: WORKSPACE_KEY_SCOPE } })
+ expect(await runAction(name, input, forged), name).toMatchObject({
+ status: 403,
+ body: { error: WORKSPACE_KEY_SCOPE },
+ })
expect(await runAction('team.invite', { email: '[email protected]', role: 'admin' }, forged)).toMatchObject({
status: 403,
})
@@ -605,8 +617,7 @@ describe('re-review of #822: N1 and N2', () => {
request(other, 'POST', '/api/auth/revoke-sessions', {}),
])
expect(revoked.status).toBe(200)
- if (minted.status === 200)
- expect(await mcp(minted.body.data.key, 'tools/list')).toMatchObject({ status: 401 })
+ if (minted.status === 200) expect(await mcp(minted.body.data.key, 'tools/list')).toMatchObject({ status: 401 })
const working = await db
.select()
.from(agent_setup_keys)
@@ -733,7 +744,10 @@ describe('security review of #832', () => {
// Holds the person's lock as a mint in flight does: End access waits for it.
await revokeSetupKeysOf(tx, own.owner.userId, 'replaced')
const end = act(own.owner, action, {})
- const early = await Promise.race([end.then(() => 'done'), new Promise(r => setTimeout(() => r('waiting'), 300))])
+ const early = await Promise.race([
+ end.then(() => 'done'),
+ new Promise(r => setTimeout(() => r('waiting'), 300)),
+ ])
return { early, end }
})
expect(result.early).toBe('waiting')
@@ -761,7 +775,10 @@ describe('security review of #832', () => {
await db.update(organization).set({ disabledAt: null }).where(eq(organization.id, own.id))
const fresh = await makeWorkspaceKey(admin)
- await db.update(session).set({ expiresAt: new Date(Date.now() - 1000) }).where(eq(session.userId, admin.userId))
+ await db
+ .update(session)
+ .set({ expiresAt: new Date(Date.now() - 1000) })
+ .where(eq(session.userId, admin.userId))
const [still] = await db.select().from(agent_setup_keys).where(eq(agent_setup_keys.id, fresh.keyId))
expect(still!.revoked_at).toBeNull() // not used yet, so not ended yet
const stateNow = await agentSetupState(admin.userId, own.id)
diff --git a/apps/api/test/setup-mcp.test.ts b/apps/api/test/setup-mcp.test.ts
index df6d09ab..9cde5c09 100644
--- a/apps/api/test/setup-mcp.test.ts
+++ b/apps/api/test/setup-mcp.test.ts
@@ -83,12 +83,20 @@ async function makeKey(who: User) {
return res.body.data as { key: string; url: string; keyId: string; expiresAt: string }
}
-/** One JSON-RPC request, the key in the path (as Claude and ChatGPT connect) or as Bearer. */
+/**
+ * One JSON-RPC request, the key in the path (as Claude and ChatGPT connect) or as Bearer. As an MCP client after
+ * initialize (MCP-Protocol-Version), unless `plainHttp`: the prompt's curl call, which sends no such header.
+ */
async function mcp(
key: string | null,
method: string,
params: Record<string, unknown> = {},
- { bearer = false, path = '/mcp/setup', from = randomIp() }: { bearer?: boolean; path?: string; from?: string } = {},
+ {
+ bearer = false,
+ path = '/mcp/setup',
+ from = randomIp(),
+ plainHttp = false,
+ }: { bearer?: boolean; path?: string; from?: string; plainHttp?: boolean } = {},
) {
const res = await appRequest(key && !bearer ? `${path}/${key}` : path, {
method: 'POST',
@@ -96,6 +104,7 @@ async function mcp(
'content-type': 'application/json',
accept: 'application/json, text/event-stream',
[FROM]: from,
+ ...(plainHttp ? {} : { 'mcp-protocol-version': '2025-06-18' }),
...(key && bearer ? { authorization: `Bearer ${key}` } : {}),
},
body: JSON.stringify({ jsonrpc: '2.0', id: ++id, method, params }),
@@ -1934,3 +1943,54 @@ describe('the phone number in the country the owner was shown (LIN-646)', () =>
}
})
})
+
+describe("an agent calling over plain HTTP (the prompt's curl way, no MCP)", () => {
+ test('setup_status carries the instructions, each answer comes once, and an MCP client sees neither change', async () => {
+ const { key } = await makeKey(ws.owner)
+ const plain = await mcp(key, 'tools/call', { name: 'setup_status', arguments: {} }, { plainHttp: true })
+ expect(plain.status).toBe(200)
+ expect(plain.body.result.structuredContent).toBeUndefined()
+ const status = JSON.parse(plain.body.result.content[0].text) as { instructions?: string; you_act_as: unknown }
+ expect(status.instructions).toBe(SETUP_MCP_INSTRUCTIONS)
+ expect(status.you_act_as).toBeTruthy()
+ // Also while waiting (read_only): a fresh agent may start with it.
+ const waiting = await mcp(
+ key,
+ 'tools/call',
+ { name: 'setup_status', arguments: { read_only: true } },
+ { plainHttp: true },
+ )
+ expect(JSON.parse(waiting.body.result.content[0].text).instructions).toBe(SETUP_MCP_INSTRUCTIONS)
+ // An MCP client got the instructions with initialize: none here, and structuredContent as before.
+ const client = data(await call(key, 'setup_status')) as { instructions?: string }
+ expect(client.instructions).toBeUndefined()
+ })
+
+ test("setup_status names each workspace's assistants with their ids, for assistant_update", async () => {
+ const { key } = await makeKey(ws.owner)
+ const status = data(await call(key, 'setup_status')) as {
+ workspaces: { id: string | null; assistants?: { id: string; name: string }[] }[]
+ }
+ const mine = status.workspaces.find(w => w.id === ws.id)!
+ expect(mine.assistants?.length).toBeGreaterThan(0)
+ expect(mine.assistants![0]).toEqual({ id: expect.any(String), name: expect.any(String) })
+ })
+
+ test('providers_list: a short list without input, the details for one category or one provider', async () => {
+ const { key } = await makeKey(ws.owner)
+ const short = data(await call(key, 'providers_list')) as {
+ providers: Record<string, unknown>[]
+ details: string
+ }
+ expect(short.providers.length).toBeGreaterThan(5)
+ expect(Object.keys(short.providers[0]!).sort()).toEqual(['category', 'label', 'picked', 'provider', 'ready'])
+ expect(short.details).toMatch(/category.*provider/)
+ const one = data(await call(key, 'providers_list', { provider: 'resend' })) as {
+ providers: { provider: string; fields: unknown[]; help: unknown }[]
+ categories: Record<string, string>
+ }
+ expect(one.providers.map(p => p.provider)).toEqual(['resend'])
+ expect(one.providers[0]!.fields.length).toBeGreaterThan(0)
+ expect(Object.keys(one.categories)).toEqual(['email'])
+ })
+})
diff --git a/apps/api/test/workspace-limit-retired.test.ts b/apps/api/test/workspace-limit-retired.test.ts
index 341b3b33..55bf7fb7 100644
--- a/apps/api/test/workspace-limit-retired.test.ts
+++ b/apps/api/test/workspace-limit-retired.test.ts
@@ -147,6 +147,7 @@ test('the setup agent: past the old limit, but one setup link still creates at m
headers: {
'content-type': 'application/json',
accept: 'application/json, text/event-stream',
+ 'mcp-protocol-version': '2025-06-18',
[FROM]: randomIp(),
},
body: JSON.stringify({
diff --git a/packages/actions/src/agent-setup.ts b/packages/actions/src/agent-setup.ts
index f8d58b6e..8b48e93f 100644
--- a/packages/actions/src/agent-setup.ts
+++ b/packages/actions/src/agent-setup.ts
@@ -634,7 +634,7 @@ function changeSettingsPrompt(url: string, connector: boolean, change: SetupChan
* How to talk to the person, in every setup MCP's `instructions`: in their own language (setup_status.you_act_as names
* it, the language they use the app in) and, first, a short plan a business owner without tech knowledge follows.
*/
-const TALKING_TO_THEM = `Talking to the person: use the language setup_status.you_act_as.language names (the language they use Linedesk in), unless they write to you in another one. Your first reply: one short greeting, then the business setup_status already knows (workspaces[].known) in one line to confirm, and nothing else: no plan, no list of steps (several workspaces: suggest which one to start with). Then go step by step, one question at a time, and set up only what matters for the first calls. Use what you already know (setup_status, the business's website, your own memory of the person) to propose concrete values (greeting, services, hours, the mobile for urgent calls, an area code) and ask only to confirm or correct them; say when a value is your suggestion. When you reach a step, say in one plain sentence what it is for. Right after the business is confirmed, offer once to look through their emails for typical customer requests and their usual answers (the business step's how in setup_status says how, and what may be saved: only general questions and answers, never anyone's personal data). Never use internal terms (workspace id, pickup mode, transfers, onboarding step, KYC) without saying in plain words what they mean.`
+const TALKING_TO_THEM = `Talking to the person: use the language setup_status.you_act_as.language names (the language they use Linedesk in), unless they write to you in another one. Your first reply: one short greeting, then the business setup_status already knows (workspaces[].known) in one line to confirm, and nothing else: no plan, no list of steps (several workspaces: suggest which one to start with). If you were asked to change something that is set up already (a provider, a workspace's or an assistant's settings), not to set it up, your first reply is instead one short greeting and the question what to change, with what is set now where it helps. Then go step by step, one question at a time, and set up only what matters for the first calls. Use what you already know (setup_status, the business's website, your own memory of the person) to propose concrete values (greeting, services, hours, the mobile for urgent calls, an area code) and ask only to confirm or correct them; say when a value is your suggestion. When you reach a step, say in one plain sentence what it is for. Right after the business is confirmed, offer once to look through their emails for typical customer requests and their usual answers (the business step's how in setup_status says how, and what may be saved: only general questions and answers, never anyone's personal data). Never use internal terms (workspace id, pickup mode, transfers, onboarding step, KYC) without saying in plain words what they mean.`
/**
* The setup MCP's `instructions` for a workspace owner's link: one workspace's steps, nothing of the server's. Its
diff --git a/packages/i18n/locales/en/server.json b/packages/i18n/locales/en/server.json
index 930c6d44..fc1f4188 100644
--- a/packages/i18n/locales/en/server.json
+++ b/packages/i18n/locales/en/server.json
@@ -608,6 +608,7 @@
"setupAgent.prompt.toolsConnector": "How to reach the tools:\n- Use the tools of the Linedesk setup connector (setup_status, {example} and so on).\n- If you do not see them, tell me to turn the connector on in this chat first.",
"setupAgent.prompt.toolsServer": "How to reach the tools (the setup server is {url}):\n- If you have tools named setup_status, {example} and so on (the \"linedesk-setup\" MCP server), use them.\n- If not, but you can run shell commands, call the same tools over HTTP. Each call is one POST:\n {curl}\n The answer is a line starting with \"data: \" followed by JSON. Use \"method\":\"tools/list\" once to see every tool and its input.\n- If you can do neither, tell me to connect you to that address as an MCP server first.\nThe address contains a setup key that stops working after {hours} hours, for security. Do not repeat it, post it or save it anywhere.",
"setupAgent.prompt.workspace": "You are helping me set up my business in Linedesk, an AI receptionist that answers my business's phone calls. The server is already run for me; please set up my business end to end with me, through the Linedesk setup tools. It takes about 10 minutes.\n\n{tools}\n\nHow to start: call setup_status first. It has what Linedesk already knows about my business (workspaces[].known: its name, what it does, city, country, website). Also use what you already know about me and my business from your own memory or this conversation. Your first reply is only this: one short greeting, then the business in one line to confirm, for example \"I'll set up Linedesk for Brightwater Plumbing (plumber, Portland, OR). Is that right?\". No plan, no list of steps. If there are several workspaces, suggest which one to start with.\n\nHow to work: go step by step, one question at a time, and set up only what matters for the first calls. Do as much as you can yourself: from what you know (above all the type of business), propose concrete values for the next step (greeting, services, opening hours, the mobile number for urgent calls, an area code) and ask me only to confirm or correct them. Say when a value is your suggestion. When you reach a step, say in one plain sentence what it is for.\n\nThe steps, in this order (for you; do not list them to me):\n1. My business: its name, website, services and opening hours, so the assistant can answer callers. I give the name or website; you draft the rest with business_search and business_import, and I check it.\n2. What my customers usually ask: right after we confirm my business, ask me once: \"Shall I look through your emails for typical customer requests and how you usually answer them?\" Only with my yes. If my email is connected in your app (Gmail, Google Workspace or Outlook), read customer requests from the last 3 to 6 months, never personal or internal mail. If it is not connected, tell me in one line where to connect it (Claude: {claudeConnectors}, ChatGPT: {chatgptPlugins}), or I paste a few emails here, or we skip it. Make a short list of typical questions and my usual answers (prices, call-out fee, service area, hours, booking, emergencies, what I don't do), show it to me, and after I agree save only that list, each as a line \"If a caller asks \"…\": …\" in the About text. Never save an email, a customer's name, address, email address or phone number. Before saving, tell me what you will save.\n3. My assistant: its name, greeting and voice. You suggest them; I keep them or change them.\n4. When it answers: only calls I miss, only after hours, or every call. I choose.\n5. Call alerts: after every call I get an email with a short summary, and urgent calls can be put through to my mobile. I give the mobile number.\n6. Starting my free trial (or my plan, if I get no trial): only if setup_status lists this step. I do it myself on the setup page with my card; you never start it and never ask for card details. The phone number follows once it runs.\n7. Phone number: the number my callers reach the assistant on. Either a new local number, or I keep my own number and forward the calls I miss to it. setup_status says what it costs.\n8. Forwarding and a test call: you show me the codes to dial on my business phone, and I call my assistant once on the setup page.\n\nWhile we work:\n- Call setup_status first, and again after each step. It says what is done and exactly how to do the next step. Read the setup server's instructions too.\n- One question at a time, short plain messages, no technical terms. Recommend a default and say why in one line.\n- Ask before anything that costs money (a phone number) or cannot be undone, and say what it costs.\n- If a tool refuses, read its message: it says what to do.\n- At the end, give me a short summary of what is set up and what is left for me, then end your own access with setup_endAccess (if steps are still open, ask me first).\n\nTalk to me in English.",
+ "setupAgent.providersList.details": "Call providers_list with { category } or { provider } for fields, help text and redirect URIs.",
"setupAgent.report.anAgent": "an AI agent",
"setupAgent.report.askLater": "Right after a step fails or blocks you, offer the admin a short setup report about it; at the end of the setup ask once (feedback_send; its first call only shows the preview).",
"setupAgent.report.askNow": "The setup is done: ask the admin now, once, whether to send the Linedesk team a short setup report, even if all went well (feedback_send; its first call only shows the preview).",