> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# See tool calls, sessions, errors and audit logs from the terminal
URL: https://metorial.com/docs/platform/cli/logs-and-audit

List sessions, tool calls, errors, alerts and organization audit logs with metorial-admin, filter them by person, session or date, and export them as JSON.

---

Every tool call that goes through Metorial is recorded with its session, the tool, the input, the result and who made it. `metorial-admin sessions` reads those records, and `metorial-admin audit-logs` reads the separate organization audit log of admin and security activity. Add `--format json` and you have an export you can filter with `jq` or load into another system.

**What you'll learn**

* How to find a session and the tool calls inside it
* How to list failed calls, errors and alerts
* How to read the organization audit log

**Before you start**

* The `metorial-admin` CLI, signed in ([install and sign in](https://metorial.com/docs/platform/cli))
* At least one tool call made through an integration or Magic MCP server

Session, tool call, error and alert commands read one instance. If your profile can reach several, add `--instance <instance-id>`. Audit logs belong to the organization.

## Find a session

A session groups the tool calls of one connection.

```bash
metorial-admin sessions list --limit 20
metorial-admin sessions list --search github --status active
metorial-admin sessions list --consumer-id <consumer-id>
metorial-admin sessions get <session-id>
```

`--search` matches the session ID and the names of the related provider, agent, identity and consumer. `--status` accepts `active` and `archived`. To see only one person's sessions, pass their consumer ID, which you can look up with `metorial-admin consumers list --email <email>`.

## List tool calls

`sessions tool-calls list` works across all sessions, so you can start from a person, a tool or a status without knowing the session first.

```bash
# Every call in one session
metorial-admin sessions tool-calls list --session-id <session-id>

# Failed calls by one person
metorial-admin sessions tool-calls list --consumer-id <consumer-id> --status failed

# Calls to one tool, by key or name
metorial-admin sessions tool-calls list --search create_issue
```

`--status` accepts `succeeded`, `failed` and `waiting_for_response`. Each record carries the `tool_key`, `status`, `input`, `output` and `error`, and the IDs of the session and connection it ran in. To read one in full:

```bash
metorial-admin sessions tool-calls get <tool-call-id> --format json
```

> **Note:** Whether `input` and `output` hold the full payload depends on the project's data retention setting. A project can store full message data, intent only, or none.

## List errors

Errors are failures in processing a message, as opposed to a tool that ran and returned an error result.

```bash
metorial-admin sessions errors list --session-id <session-id>
metorial-admin sessions errors list --type message_processing_provider_error
metorial-admin sessions errors get <session-error-id>
```

`--type` accepts `message_processing_timeout`, `message_processing_provider_error` and `message_processing_system_error`. Each error has a `code`, a `message` and a `similar_error_count` that tells you how often the same failure occurred.

## List alerts

Alerts come from monitors, for example when a prompt-monitoring filter matches or a provider's tool schema changes.

```bash
metorial-admin monitoring alerts list --status pending
metorial-admin monitoring alerts list --session-id <session-id>
metorial-admin monitoring alerts get <monitor-alert-id>
metorial-admin monitoring alerts resolve <monitor-alert-id>
```

`--status` accepts `pending`, `resolved` and `ignored`. `--source` accepts `protoguard` and `specification_change`.

## Filter by date

The list commands above take `--created-at` with a JSON object. `gt` is the lower bound and `lt` is the upper bound, and both are exclusive.

```bash
metorial-admin sessions tool-calls list \
  --created-at '{"gt":"2026-11-01T00:00:00Z","lt":"2026-11-08T00:00:00Z"}' \
  --status failed
```

## Read the organization audit log

The audit log records security and administration activity in the organization, including portals, skills and Workforce.

```bash
metorial-admin audit-logs list --limit 50 --order desc
metorial-admin audit-logs get <audit-log-id>
```

`audit-logs list` has paging flags only: `--limit`, `--order`, `--after`, `--before` and `--cursor`. It has no filter for actor, action or date. To narrow the results, export JSON and filter it yourself.

## Export to a file

Lists are paged. Take the cursor from the end of one page and pass it to the next call with `--after`.

```bash
metorial-admin sessions tool-calls list --limit 100 --format json > tool-calls-1.json
metorial-admin sessions tool-calls list --limit 100 --format json --after <cursor> > tool-calls-2.json
```

## In the dashboard

The same data is under **Logs**. **Connection Logs** has **Sessions**, **Tool Calls** and **Issues**. The organization audit log is in organization settings under **Audit Logs**.

## Check it worked

Make one tool call, for example with [`metorial call`](https://metorial.com/docs/platform/cli/call-a-tool). Then run `metorial-admin sessions tool-calls list --limit 1 --order desc`. The newest record should be your call, with the tool key you used.

## Next steps

* [Review connection logs in the dashboard](https://metorial.com/docs/platform/integrations/review-connection-logs)
* [Audit logs, retention and SIEM export](https://metorial.com/docs/platform/guides/audit-logs)
* [Inspect what an agent did](https://metorial.com/docs/platform/workforce/inspect-agents)