See tool calls, sessions, errors and audit logs from the terminal
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-adminCLI, signed in (install and sign in) - 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.
--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.
--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:
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.
--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.
--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.
Read the organization audit log
The audit log records security and administration activity in the organization, including portals, skills and Workforce.
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.
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. 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.