Skip to content
QwryAI
Documentation
Pages

Getting Started

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/<name> and POST /reviews/<reviewId>/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.

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":"<agentId>","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":"<agentId>","expectedUpdatedAt":"2026-12-01T13:50:39.104Z","changes":[{"field":"temperature","value":0.3}]}'
JSON
{
  "success": true,
  "data": {
    "status": "review_required",
    "reviewId": "<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 <reviewId>

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.

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

OptionPurpose
tools:call <name>The tool to run, as tools:list names it
--args '<json>'The tool's input as one JSON object. Arrays and plain values are refused
apply <reviewId>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 statuserror.codeWhen
400INVALID_ARGUMENTS--args doesn't match the tool's input schema
400CHATBOT_ID_REQUIREDAn agent tool was called without a valid chatbotId
401API_KEY_REQUIREDNo credential was sent
401INVALID_API_KEY / INVALID_OAUTH_TOKENThe key or browser login was revoked, expired or mistyped
403INSUFFICIENT_PERMISSIONThe credential wasn't granted the permission the tool needs
403CREATOR_NOT_ACTIVEThe member who created the credential left the workspace
404UNKNOWN_TOOLNo tool has that name
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in the workspace
404REVIEW_NOT_FOUNDNo review with that reviewId for this credential
409NOTHING_TO_CHANGEThe requested values are already set
409REVIEW_EXPIRED / REVIEW_ALREADY_USED / STALE_REVIEWThe review can't be applied; prepare a new one
413RESULT_TOO_LARGEThe answer is too big; narrow the filter, date range or page
429INTEGRATION_RATE_LIMIT_EXCEEDEDToo many requests from this credential; wait and retry
500TOOL_FAILEDThe tool failed; try again

Commands

CommandPurpose
qwryai-cli tools:listList the tools this credential can use, with their input schemas
qwryai-cli tools:call <name> --args '<json>'Run one tool
qwryai-cli apply <reviewId>Apply a change a tool prepared for review

Explore the documentation