---
name: tukiassistant-agents
description: Inspect, configure, compile and publish TukiAssistant agents through the TukiAssistant MCP server (tools named tukiassistant_*). Use when the user asks to review or change an agent, add FAQs or knowledge, assign skills, test an agent, or publish/pause it in TukiAssistant.
---

# Working with TukiAssistant agents over MCP

The TukiAssistant MCP server exposes the organization's control plane. Every
tool is limited by the API key's **permissions (scopes)** and by the **workspace
role** granted to the key. Act only inside what the user asked for.

## Golden rules

1. **Read before writing.** Resolve ids with `tukiassistant_list_workspaces` →
   `tukiassistant_list_agents` (`workspaceId`) → `tukiassistant_get_agent`
   (`agentId`). Never guess an id; never ask the user for an id you can look up.
2. **Confirm before anything visible to customers.** Publishing, pausing,
   resuming, archiving and restoring change what end customers see. Summarize
   the change and get an explicit "yes" first.
3. **Never handle secrets.** Do not ask for, print or store API keys, webhook
   secrets or tokens. If a tool needs one, tell the user to set it in the
   TukiAssistant dashboard.
4. **Report what the tool returned**, not what you expected. If a call fails,
   quote the error and stop; do not retry the same call blindly.

## Typical flows

### Review an agent
- `tukiassistant_get_agent` — status (`draft`, `published`, `paused`…), name,
  runtime settings, `draftVersionId` / `publishedVersionId`.
- `tukiassistant_get_agent_versions` — compiled prompt versions (paginated).
- `tukiassistant_get_agent_skills`, `tukiassistant_get_agent_appearance`,
  `tukiassistant_get_agent_webhook` for the rest of the configuration.
- `tukiassistant_get_workspace_usage` — credits and agent quota.

### Change knowledge
- `tukiassistant_create_faq` (`question`, `answer`, `status`: `answered` by
  default) and `tukiassistant_create_knowledge` (`key`, `value`).
- Each call reindexes the agent: batch your changes in one pass instead of
  creating items one sentence at a time.
- Use the business's real data only. If something is unknown, ask the user;
  never invent prices, policies, schedules or contact data.

### Change behavior
- `tukiassistant_update_agent` for name, display name and runtime settings.
- Agent skills (TukiAssistant's own reusable instructions, not this file):
  `tukiassistant_list_skills`, `tukiassistant_create_skill`,
  `tukiassistant_publish_skill`, `tukiassistant_replace_agent_skills`
  (replaces the whole list: read the current one first and send the full set).

### Compile, test, publish
1. `tukiassistant_compile_agent` builds a new draft version from the current
   configuration. Do not hand-write the compiled prompt.
2. Test with `tukiassistant_query_agent` (needs the "Run queries" permission).
   Each query creates a real conversation and consumes credits: use a
   recognizable `sessionExternalId` such as `mcp-test-<date>`. Good test set:
   a core question, one whose answer is **not** in the knowledge (the agent
   must say it does not know), an off-topic question, and one in another
   language.
3. Only after the user approves: `tukiassistant_publish_agent`.
   `tukiassistant_pause_agent` takes it offline again.

## Write tools, jobs and retries

Write tools return a `jobId` and a `status`. When the call is retried with the
same input and idempotency key, the server returns the existing job instead of
doing the work twice. Use `tukiassistant_get_job` to check a job that is still
`processing`.

## Errors

| Error | Meaning | What to tell the user |
|---|---|---|
| `Missing required scope: <scope>` | The API key lacks that permission | Edit the key's permissions in **Organization → API keys** (or create a new key) |
| `Forbidden` / access denied | The key's workspace role is too low or the workspace is not granted | Grant the key the right workspace and role |
| `Agent not found` | Wrong id or another workspace | Re-list agents in the granted workspace |
| Rate limited | Too many calls | Wait and retry later |

Permission names in the dashboard: *View agents* (`agents:read`), *Edit agents*
(`agents:write`), *Publish agents* (`agents:publish`), *Manage knowledge*
(`knowledge:write`), *Run queries* (`runtime:invoke`), *Read agent data*
(`data:read`), *Add data and shorten retention* (`data:write`).
