# CLI API > List every QwryAI tool your credential can use, call any of them from the terminal, and apply the changes they prepare Every QwryAI CLI task runs through the same three commands: `tools:list`, `tools:call` and `apply`. They map one-to-one onto the public API, `GET /tools`, `POST /tools/` and `POST /reviews//apply` under `https://api.qwryai.com/public/v1`, and they offer the same tools as the QwryAI MCP server. Sign in first; see [CLI Auth](/docs/cli/auth). ## List tools See every tool the credential may use right now, each with its description and input schema: ```bash qwryai-cli tools:list ``` ```json { "success": true, "data": { "tools": [ { "name": "list_agents", "description": "List the workspace's agents (chatbots): id, name, status and training state, twenty per page. Pass an agent's id as chatbotId to the agent tools.", "inputSchema": { "type": "object", "properties": { "page": { "type": "integer", "minimum": 1, "maximum": 1000 } }, "additionalProperties": false }, "annotations": { "readOnlyHint": true, "destructiveHint": false } } ] } } ``` The list depends on the permissions you granted the credential. A tool you can't see needs a permission it doesn't hold. Print just the names with `jq`: ```bash qwryai-cli tools:list | jq -r '.data.tools[].name' ``` `annotations.readOnlyHint` is `true` for tools that only read. Tools that change something say in their description that they return a review. ## Call a tool Pass the tool's name and its input as one JSON object in `--args`: ```bash qwryai-cli tools:call search_knowledge --args '{"chatbotId":"","query":"refund policy","limit":2}' ``` Tools that work on one agent need its `chatbotId`, the `id` from `list_agents`. Workspace tools such as `list_agents` and `get_account_context` take no agent. Leave `--args` out when a tool needs no input: ```bash qwryai-cli tools:call get_account_context ``` The reply is `{"success":true,"data":…}`, where `data` is what the tool returned. ## Apply a reviewed change Tools that change settings, sources, actions or procedures prepare the change and answer with a review instead of making it. (Conversation tools such as `send_message` act straight away, the way a customer or an Inbox agent would.) ```bash qwryai-cli tools:call update_model --args '{"chatbotId":"","expectedUpdatedAt":"2026-12-01T13:50:39.104Z","changes":[{"field":"temperature","value":0.3}]}' ``` ```json { "success": true, "data": { "status": "review_required", "reviewId": "", "tool": "update_model", "changes": [{ "title": "Temperature", "before": 0.7, "after": 0.3 }], "unchanged": [], "expiresAt": "2026-12-01T18:36:47.108Z", "next": "Show these changes to the user. Call apply_change with this reviewId only after they approve; the review expires in 15 minutes." } } ``` Read the `before` and `after` of each change. If they're right, apply the review: ```bash qwryai-cli apply ``` The reply has `"status": "succeeded"`, the `tool`, what the change returned in `data`, and a `receipt` with `"applied": true` once QwryAI has confirmed the change. > [!WARNING] > > A review expires after 15 minutes and can be applied once, by the credential that prepared it. If the setting or source changed after the review was prepared, `apply` refuses with `STALE_REVIEW`: call the tool again for a fresh review. Tools that edit an agent's settings ask for `expectedUpdatedAt`, copied from the `updatedAt` that `agent_configuration` or `get_chat_interface` returns. Source tools ask for the source's `expectedVersion` from `list_sources`. Both stop you overwriting a change someone else just made. ## Request options | Option | Purpose | | - | - | | `tools:call ` | The tool to run, as `tools:list` names it | | `--args ''` | The tool's input as one JSON object. Arrays and plain values are refused | | `apply ` | Apply the review a tool returned | Quote the JSON in single quotes in bash and zsh. To build it from shell variables, use double quotes and escape the inner ones, as in `--args "{\"chatbotId\":\"$AGENT\"}"`. ## Errors A failed call exits with a non-zero code and prints the reason: ```json {"success":false,"error":{"message":"This credential does not hold MANAGE_AGENT_SOURCES, which add_url_source requires","httpStatus":403,"code":"INSUFFICIENT_PERMISSION"}} ``` | HTTP status | `error.code` | When | | - | - | - | | 400 | `INVALID_ARGUMENTS` | `--args` doesn't match the tool's input schema | | 400 | `CHATBOT_ID_REQUIRED` | An agent tool was called without a valid `chatbotId` | | 401 | `API_KEY_REQUIRED` | No credential was sent | | 401 | `INVALID_API_KEY` / `INVALID_OAUTH_TOKEN` | The key or browser login was revoked, expired or mistyped | | 403 | `INSUFFICIENT_PERMISSION` | The credential wasn't granted the permission the tool needs | | 403 | `CREATOR_NOT_ACTIVE` | The member who created the credential left the workspace | | 404 | `UNKNOWN_TOOL` | No tool has that name | | 404 | `CHATBOT_NOT_FOUND` | No agent with that `chatbotId` in the workspace | | 404 | `REVIEW_NOT_FOUND` | No review with that `reviewId` for this credential | | 409 | `NOTHING_TO_CHANGE` | The requested values are already set | | 409 | `REVIEW_EXPIRED` / `REVIEW_ALREADY_USED` / `STALE_REVIEW` | The review can't be applied; prepare a new one | | 413 | `RESULT_TOO_LARGE` | The answer is too big; narrow the filter, date range or page | | 429 | `INTEGRATION_RATE_LIMIT_EXCEEDED` | Too many requests from this credential; wait and retry | | 500 | `TOOL_FAILED` | The tool failed; try again | ## Commands | Command | Purpose | | - | - | | `qwryai-cli tools:list` | List the tools this credential can use, with their input schemas | | `qwryai-cli tools:call --args ''` | Run one tool | | `qwryai-cli apply ` | Apply a change a tool prepared for review | > [!NOTE] > > The tool names, inputs and outputs are the same in the CLI, the [MCP Server](/docs/developer-guides/mcp) and the public API, so a call you test here works unchanged in the other two.