Reads
agent_list
List the agents this user can see.
Returns:
{ agents: [...], count }. Each row carries id, agent_name, display_name, department, department_id, role, model, phase, is_active, schedule, execution_type, mode, scope, owner_user_id, reports_to, created_at. schedule is the effective schedule — the schedule column if set, else the enabled trigger_config.schedule cron (tagged source:"trigger_config"), else null.
Permissions: read; owner/department/tenant visibility.
agent_get
Full configuration of one agent: briefing/prompt, model, trigger config, schedule, delivery, tools, skills and per-view data preferences (pinned columns, default filters, row cap).
Returns:
{ agent, mcp_servers, view_prefs }. agent is the full detail record (all list columns plus system_prompt, mandate, model_settings, trigger_config, delivery_channels, tools_access, knowledge_access, memory_filter, budget_limit, decision_bounds, delivery_webhooks, api_actions, alive_mode/alive_state/alive_heartbeat_at, avatar_*, billing_policy, max_credits_per_run, human_minutes_per_run, hourly_rate_usd) with schedule resolved to the effective value. mcp_servers resolves each mcp:<uuid> grant to {ref, label, enabled, read_only_tools} (or a status marker DEAD/UNVERIFIED for refs whose server is gone or unreadable). view_prefs is the per-view pinned-column/filter/row-cap config. Missing or not-visible → { error: "Agent not found" }.
Permissions: read; visibility-gated.
agent_versions_list
The agent’s config-version history (before-edit snapshots): version number, kind (edit/promote/scope_change), actor, timestamp and identifying snapshot fields. Restore stays UI-only.
Returns:
{ versions: [{version, kind, actor, created_at, name, model, role}], note } — newest first. name/model/role are pulled from the before-snapshot as identifying fields; the full snapshot body is dropped here (use agent_version_get for it).
Permissions: read; visible only if you can see the agent.
agent_version_get
One config version with its full before-snapshot — the read for the actual config behind a version row. Use it to answer “what changed between versions” or to inspect a config before restoring in the UI.
Returns:
{ version, kind, actor, created_at, snapshot, note }. snapshot is the complete before-state config object for that version (empty object if the row stored none).
Permissions: read; visibility-gated.
agent_stats_get
Lifetime run stats for one agent over a day window: total runs, success rate, average duration, total cost USD — same aggregation as the app’s Runs & Cost tab.
Returns:
{ total, success_rate, avg_duration_sec, total_cost_usd, days } — counts only completed (non-running) runs in the window; success_rate is a whole-number percent, total_cost_usd is rounded to 4 decimals.
Permissions: read; visibility-gated.
Writes
agent_create
Create a complete agent — briefing, mandate, hierarchy, skills, tools, schedule, delivery. Server-enforced rules: agent_name is NN_lowercase_words (e.g. 30_market_scanner); system_prompt is a real briefing (min 80 chars); non-ceo agents report to the CEO by default; model defaults to the tenant’s master setting.
Returns:
{ agent, skills_linked, data_sources_configured?, warnings?, note }. agent is the inserted row projected to id, agent_name, display_name, role, reports_to, department, is_active, trigger_config, model_settings; skills_linked is the count of preload skills wired; data_sources_configured appears only when view-prefs were set; warnings collects non-fatal self-checks (e.g. unknown tool ref, digest.enabled without a knowledge-write tool). Validation problems return { error } naming the exact field.
Permissions: write; Company-Admin only.
agent_update
Merge-patch an existing agent. Only supplied fields change. Supports dry_run:true for a field-level from → to preview without writing (no version snapshot, no skill relink).
Credential assignments (
allowed_credentials) are deliberately not writable over MCP — manage credentials in the app.
Returns: live apply → { ok:true, updated: [changed keys], skills_replaced?, view_prefs_replaced?, warnings? } (updated is the list of patched column names; skills_replaced/view_prefs_replaced are counts, present only when those were replaced). Dry-run → { dry_run:true, valid:true, would: { action:"update_agent", target_id, changes: {<field>:{from,to}}, skills_replaced?, view_prefs? }, warnings?, note } — no write, no version snapshot, no skill relink.
Permissions: write; Company-Admin only (Superadmin for the pricing fields).
agent_run
Trigger an agent run from outside — always through the human-in-the-loop gate, never silently. Creates an approval (Telegram buttons when connected, otherwise the in-app approvals inbox); on approve, the tenant CEO delegates the run. Track it with agent_run_list. The CEO agent itself is triggered by talking to it, not here.
Returns:
{ status:"pending_approval", approval_id, channel, note }. channel is "telegram" when the user has a connected chat + bot, otherwise "inbox" (approve via the app or approval_resolve). On approve, the CEO delegates the run — track it with agent_run_list. Guard failures return { error } (e.g. inactive agent, no CEO, CEO lacks spawn_agent, or targeting the CEO itself).
Permissions: write; execution proceeds only after a human approves.
Schedules
agent_schedule_manage
Enable/disable or change an agent’s recurring schedule (5-field cron, timezone-aware — defaults to the user’s timezone). Verify the first run fires via agent_run_list or agent_schedule_verify.
Returns: live apply →
{ ok:true, agent, schedule: {enabled, cron, rrule, timezone}, note } (agent is the agent_name). Dry-run → { dry_run:true, valid:true, would: { action:"manage_schedule", target_id, changes: {<field>:{from,to}} }, note } — only actually-changing fields appear under changes.
Permissions: write; Company-Admin only.
agent_schedule_verify
Verify an agent’s schedule actually fires (a stored cron is not proof): compares the configured schedule against the last scheduled run and returns a verdict.
Returns:
{ agent, is_active, schedule: {enabled, cron, timezone}, last_scheduled_run, verdict, note }. verdict is one of ok | stale | never_fired | pending_first_window | agent_inactive | disabled; last_scheduled_run is the newest trigger_type=schedule run row (id, status, started_at, finished_at) or null; note explains the verdict.
Permissions: read.
Runs
agent_run_list
Recent agent runs (only for agents you can see): status, trigger type, duration, summary, errors.
Returns:
{ runs: [...], count }. Each row: id, agent_id, agent_name, status, trigger_type, triggered_by, started_at, finished_at, duration_sec, summary, error_msg, parent_run_id, spawn_depth. Runs are pre-filtered to agents you can see; if you can see none, { runs: [], count: 0 }.
Permissions: read; agent visibility applies.
agent_run_get
One agent run in detail, including input and step receipts (tool calls, durations, errors).
Returns:
{ run, steps }. run carries the list-row columns plus input_text; steps is the ordered step trail (up to 100) of {step_id, step_type, ok, duration_ms, error_msg, created_at}. Missing or not-visible → { error: "Run not found" }.
Permissions: read; agent visibility applies.
agent_search_runs
Full-text search your own past runs by term — recall what an agent did before. Returns matched runs with a snippet + run id (fetch the full run with agent_run_get). Use for past-run recall; use memory_search for stored facts and knowledge_search for the knowledge base.
Returns:
{ runs: [{id, agent_id, agent_name, status, trigger_type, started_at, duration_sec, snippet}], count, fts }. snippet is a ~240-char window around the first hit; fts is true when the Postgres full-text index served the query, false when it fell back to ILIKE.
Permissions: read; tenant + agent visibility.
Integration connection checks
Third-party integrations (Gmail, Slack, …) are connected per user via OAuth in the app UI only — no connect tool exists by design (secrets and OAuth flows never travel the LLM channel). These reads let you verify a connection before grantingcomposio:* tools to an agent.
composio_connection_list
List the authenticated user’s third-party integration connections: provider, status, account id and timestamps.
Returns:
{ connections: [{id, provider, status, composio_account_id, created_at, connected_at, last_used_at}], count }. Internal entity ids (composio_user_id) are never exposed.
Permissions: read; own connections only.
composio_connection_check
Check whether the user has an active connection for a specific provider. Returns connected:true only when the status is active and the OAuth handshake completed.
Returns:
{ provider, connected, status } — connected:true only when the newest connection is status:"active" and the OAuth handshake completed (composio_account_id set). When no connection exists: { provider, connected:false, status:null, hint }.
Permissions: read; own connections only.
