actions discovers and runs them; agents is a typed wrapper over the agent_run Action; the resource namespaces (comments, notifications, integrations, automations, code, sites, servers) wrap the workspace APIs those Actions sit on. All of it runs as the current identity, under whatever the host granted.
Discover before you run
list and schema are the contract; do not hard-code an input shape you have not read from schema. describe explains a single field, which is what an agent or a settings UI uses to offer valid values.
actions.enabled and actions.readOnly tell you what the host granted before you try: inside a preview they mirror the Actions switch and the file grant, on a server they are always on, and in an agent script they follow the turn. await actions.ready resolves once the host has reported.
Run
status on every receipt. A run may be queued or fail after acceptance, and an accepted write must not be retried blindly; give writes an idempotencyKey so a retry after a dropped connection is safe. getRun needs a durable run: a synchronous read without an idempotency key may report a runId for audit only and answer getRun with not_found.
Connector tools
Inside an app opened in Arg, the viewer’s MCP connectors are Actions too. A tool’s id ismcp__<connector>__<tool>, the same name the agent calls it by, and it runs through the viewer’s own account (or one shared with them) for whichever connectors they switched on in this workspace. That lets a dashboard read live data straight from a connector:
data is the tool’s structuredContent when it sends one, otherwise its text parsed as JSON, otherwise null; text and the raw MCP content blocks are there for tools that answer in prose. A tool that reports an error, or a connector that needs reconnecting, rejects the call rather than returning the error as data. A viewer without the connector gets not_found, so show them which one to connect.
Every connector tool needs workspace write access, since MCP tools carry no dependable read/write marking. Calls are not recorded as durable runs, so getRun does not find them. A deployed Site or Server calls Actions with its own token, which has no connectors, so connector tools are not available there.
Agent runs
agents.run is the agent_run Action with typed options: agentName to pick a workspace subagent, chatId to continue a chat, model, maxToolIterations, readOnly, and logPath / logFormat to have the run write its own transcript into the workspace. There are two statuses to inspect: the Action’s (run.status) and the agent’s (run.output.status). Both must be terminal and successful before run.output.result is meaningful. Compare with chat, which starts a conversation you can watch and continue in the UI; agents.run is a run you wait for.
Workspace resources
Each namespace maps onto the workspace APIs and keeps their permissions. Paths are cloud workspace paths even under an authenticatedarg serve, where fs reads local disk: a comment or an automation refers to the file in the cloud workspace, never to an unuploaded file on your machine.
A few notes that keep these honest:
notifications.sendToMetargets the current user.sendToUsertakes a user id fromusers.list(). The lower-levelsendstill accepts ausersarray for fan-out or email-address recipients. Notification input acceptstitle,body,type,metadata,targetandchannels; provide at least a title or target. Channels narrow delivery toios,emailandin-app, and each recipient’s preferences still apply.permissions.shareFileandshareFoldergrant an Arg userread,writeormanageaccess;list,updateandrevokeread and change the direct grants on a path, so a sync script can remove access as well as add it. All of them need a user principal (a session or a user-owned API key), not a service account. The caller needsmanageon the path, the recipient must belong to the workspace organization, and a folder grant applies to its descendants.adminis deliberately unavailable because it is a workspace-level permission.integrations.connectionsnever returns credentials, only which providers are connected.integrations.proxyis a separate server capability for Sites and Servers (see capability tokens); it is not general HTTP authority for a viewer or an agent.code.runexecutes a shell command in the workspace sandbox. Inspectstatus; a non-zero exit isfailed, not an exception.sitesframeworks arestatic,vite,astro,nextandworker;accessispublicorworkspace. A build that is not auto-promoted produces a version you promote later. See tunnels and servers for the lifecycle behindservers.
actions and agents behind the Actions switch; the resource namespaces need a server, CI, arg serve in account mode, a hosted gateway, or an agent script.