MCP tools
The Scout Trails MCP server offers twelve read-only tools. Your assistant chooses and calls them for you; this page describes what each one accepts and returns so you know what to ask for and how to read the answers. Every tool reads only your organization’s data.
How results look
- Each tool returns one JSON object, both as structured content and as the same JSON in a text block.
- Timestamps are RFC 3339 strings in UTC.
- A list with nothing in it may come back as
nullrather than[]. - When a tool fails, the call returns a JSON-RPC error (code
-32603) whose message starts with the tool name, for exampleget_session: session "abc" not foundoractivity: unsupported granularity "2h" (want one of: 1m, 5m, 15m, 1h, 1d). Calling a tool that does not exist returns code-32602.
Time windows
The insight tools (activity, top_tools, outlier_sessions, cost_summary, risk_feed, external_domains) look back from the current time over a window:
- Write it as a number and unit:
30m,6h,24h,7d,90d. Units ares,m,handd.s,mandhcan be combined, as in1h30m;dmust be used on its own, as in7d. Weeks (w) are not accepted; use7d. - The default is
24h. A window shorter than one minute is raised to1m; a window longer than 90 days is reduced to90d. - The response echoes the window in hours, minutes and seconds:
24hcomes back as"24h0m0s"and7das"168h0m0s".
Limits and pagination
limit inputs are clamped to 1–200; a missing, zero or negative limit uses the tool’s default. list_sessions and list_tool_calls return a next_cursor when more rows exist; pass it back as cursor, with the same filters, to get the next page.
Actor and team filters
actor takes one actor telemetry id, and team takes a list of them. Telemetry ids are listed in the Telemetry id column of Manage > Actors & ingest keys and returned as actor_id. A dashboard team name does not work as team; pass the telemetry ids of the team’s actors.
ping
Checks the connection. Takes no inputs.
{"ok": true, "version": "0.1.0"}
whoami
Returns the organization the API key belongs to. Takes no inputs.
{"tenant_id": "ExampleTenantId_ExampleTenantId_ExampleTena"}
tenant_id matches the value under Telemetry tenant on Manage > Organization.
list_sessions
Lists sessions, most recent activity first.
| Input | Type | Description |
|---|---|---|
limit | number | Sessions to return, 1–200. Default 50. |
after | string | RFC 3339 time. Only tool calls after this time. |
before | string | RFC 3339 time. Only tool calls before this time. |
cursor | string | next_cursor from the previous call. |
agent | string | Only this agent, matched exactly, for example claude-code. |
actor | string | Only this actor’s telemetry id. |
team | array of strings | Only these actors’ telemetry ids. |
The time, agent, actor and team filters select tool calls, and each session is summarised from the matching calls.
{
"sessions": [
{
"session_id": "5e551011-0000-4000-8000-000000000001",
"tenant_id": "ExampleTenantId_ExampleTenantId_ExampleTena",
"actor_id": "Q2xhdWRlQ29kZS1sYXB0b3AtMDAwMDAwMDAwMDAwMDAw",
"agent_system": "claude-code",
"first_seen": "2026-09-24T15:57:39.647Z",
"last_seen": "2026-09-25T15:27:56.67Z",
"tool_calls": 68,
"duration_ms": 84617023
}
],
"next_cursor": "MTc5MDM1MDA3NjY3MDAwMDAwMHwwMjhlYTQxMS0yYThiLTQ0ZTctYTUwOS1mYzZjYTY0MjRiN2Y"
}
| Field | Description |
|---|---|
session_id | The session’s id. |
tenant_id | Your organization’s telemetry tenant. |
actor_id | Telemetry id of the actor that sent the session. |
agent_system | The agent, for example claude-code. |
first_seen, last_seen | Times of the first and last matching tool call. |
tool_calls | Matching tool calls, including rejected ones. |
duration_ms | Milliseconds between first_seen and last_seen. |
get_session
Returns one session with everything recorded in it.
| Input | Type | Description |
|---|---|---|
session_id | string | Required. The session to fetch. |
{
"session": {
"session_id": "341e6a93-2505-40d4-8bb2-03286d6b3360",
"tenant_id": "ExampleTenantId_ExampleTenantId_ExampleTena",
"actor_id": "Q2xhdWRlQ29kZS1sYXB0b3AtMDAwMDAwMDAwMDAwMDAw",
"agent_system": "claude-code",
"first_seen": "2026-09-23T17:57:00.215Z",
"last_seen": "2026-09-23T17:57:00.215Z",
"tool_calls": 1,
"duration_ms": 0
},
"tool_calls": [ { "id": "f313eb76-9727-40ef-ba69-6d03dbdbb515", "tool_name": "Bash", "outcome": "ok", "...": "..." } ],
"llm_calls": [
{
"id": "f23ace2f-1130-4c0e-8a98-a4cbc961125f",
"timestamp": "2026-09-23T17:56:59.548Z",
"session_id": "341e6a93-2505-40d4-8bb2-03286d6b3360",
"prompt_id": "2eeec48f-78b3-49ea-85cf-527fff0e261c",
"agent_system": "claude-code",
"model": "claude-opus-5-5",
"duration_ms": 3194,
"input_tokens": 2,
"output_tokens": 82,
"cache_read_tokens": 10704,
"cache_creation_tokens": 24041,
"cost_usd": 0.1961168,
"is_error": false,
"error_type": "",
"error_message": ""
}
],
"risk_flags": [],
"external_domains": []
}
| Field | Description |
|---|---|
session | The session summary, as in list_sessions, over the whole session. |
tool_calls | The session’s tool calls, oldest first, each with the fields described under get_tool_call. |
llm_calls | The model calls the agent made, oldest first: model, duration, token counts, cost, and error details when a call failed. |
risk_flags | Risk flags raised in the session: timestamp, session_id, tool_call_id, tool_name, flag and evidence. See risk_feed for the flag kinds. |
external_domains | Each reference to an external host found in the session’s tool-call arguments: timestamp, session_id, tool_call_id, tool_name, domain and scheme. |
Each list holds at most 500 entries; use list_tool_calls with session_id to page through a longer session. An unknown session returns the error get_session: session "<id>" not found.
list_tool_calls
Lists individual tool calls, newest first.
| Input | Type | Description |
|---|---|---|
session_id | string | Only calls in this session. |
actor | string | Only this actor’s telemetry id. |
team | array of strings | Only these actors’ telemetry ids. |
tool_name | string | Exact tool name, for example Bash or Edit. |
tool_type | string | builtin or mcp. |
category | string | code_exec, file_read, file_write, web_fetch, mcp or other. |
outcome | string | ok (ran and succeeded), error (ran and failed) or rejected (denied by a permission rule, a hook or a person, and never ran). Any other value is ignored and does not filter. |
after | string | RFC 3339 time. Only calls after this time. |
before | string | RFC 3339 time. Only calls before this time. |
cursor | string | next_cursor from the previous call. |
limit | number | Rows to return, 1–200. Default 50. |
Returns {"tool_calls": [...], "next_cursor": "..."}, each entry shaped as in get_tool_call.
get_tool_call
Returns one tool call by its id.
| Input | Type | Description |
|---|---|---|
id | string | Required. The tool call’s id, as returned by list_tool_calls or get_session. |
{
"id": "f313eb76-9727-40ef-ba69-6d03dbdbb515",
"tenant_id": "ExampleTenantId_ExampleTenantId_ExampleTena",
"actor_id": "Q2xhdWRlQ29kZS1sYXB0b3AtMDAwMDAwMDAwMDAwMDAw",
"timestamp": "2026-09-23T17:57:00.215Z",
"session_id": "341e6a93-2505-40d4-8bb2-03286d6b3360",
"prompt_id": "2eeec48f-78b3-49ea-85cf-527fff0e261c",
"agent_system": "claude-code",
"agent_version": "2.1.280",
"model": "",
"tool_name": "Bash",
"tool_type": "builtin",
"category": "code_exec",
"tool_call_id": "toolu_01XrWPS2d9PQcB3kWyX1XNMu",
"tool_use_id": "toolu_01XrWPS2d9PQcB3kWyX1XNMu",
"arguments": "{\"bash_command\":\"echo\",\"full_command\":\"echo hello\",\"description\":\"Print a string\"}",
"result": "",
"result_size_bytes": 12,
"duration_ms": 517,
"success": true,
"outcome": "ok",
"error_type": "",
"error_message": "",
"decision": "",
"decision_source": "",
"mcp_server_name": "",
"mcp_server_scope": ""
}
| Field | Description |
|---|---|
tool_name, tool_type, category | What the tool was and how Scout Trails classifies it. |
arguments | The tool’s input as a JSON-encoded string, present when the agent is configured to send tool arguments. See Agents. |
result | The tool’s output, when the agent sends it. |
outcome | ok, error or rejected. |
duration_ms, success, result_size_bytes | null for a rejected call, which never ran. |
error_message | The error text of a failed call. |
decision, decision_source | For a rejected call, the permission decision and what made it, for example reject from user_reject, config or hook. Empty for calls that ran. |
mcp_server_name, mcp_server_scope | The MCP server that served the tool, for MCP tools. |
prompt_id, tool_call_id, tool_use_id | Ids the agent assigned to the prompt and the call. |
Empty values are returned as "". An unknown id returns the error get_tool_call: tool_call "<id>" not found.
activity
Tool calls, model calls and model cost over time.
| Input | Type | Description |
|---|---|---|
window | string | How far back to look. Default 24h. See Time windows. |
granularity | string | Bucket size: 1m, 5m, 15m, 1h or 1d. Default 1h. |
{
"window": "720h0m0s",
"granularity": "1d",
"buckets": [
{"bucket_start": "2026-09-15T00:00:00Z", "tool_calls": 8, "llm_calls": 8, "cost_usd": 0.343967},
{"bucket_start": "2026-09-16T00:00:00Z", "tool_calls": 24, "llm_calls": 24, "cost_usd": 1.031901}
]
}
Buckets are labelled with their start time in UTC, oldest first. Buckets with no activity are omitted.
top_tools
The most-used tools in the window.
| Input | Type | Description |
|---|---|---|
window | string | Default 24h. |
limit | number | Tools to return, 1–200. Default 10. |
{
"window": "168h0m0s",
"tools": [
{"name": "Read", "count": 266, "ran": 266, "success_rate": 1, "total_cost": 7.759917},
{"name": "Bash", "count": 120, "ran": 112, "success_rate": 0.95, "total_cost": 5.10422}
]
}
| Field | Description |
|---|---|
count | Calls to the tool, including rejected ones. |
ran | Calls that ran. count - ran is the number rejected. |
success_rate | Share of calls that ran and succeeded, from 0 to 1. Successful calls are ran × success_rate. |
total_cost | The combined model cost of the sessions that used the tool in the window. A session that used several tools counts toward each of them, so these values overlap and do not add up to your total cost. |
outlier_sessions
Sessions in the window ranked by how unusual they are, measured by tool-call count and model cost.
| Input | Type | Description |
|---|---|---|
window | string | Default 24h. |
limit | number | Sessions to return, 1–200. Default 10. |
{
"window": "720h0m0s",
"sessions": [
{"session_id": "5e551011-0000-4000-8000-000000000001", "tool_calls": 68, "cost_usd": 6.997629, "outlier_score": 11.05},
{"session_id": "5a0c9e71-03d2-4c1e-9f0b-6a1f2e7d8c44", "tool_calls": 260, "cost_usd": 0, "outlier_score": 10.85}
]
}
outlier_score is the number of standard deviations the session sits above the window’s average, on tool calls or on cost, whichever is higher. The list is sorted by score and always returns up to limit sessions, so the lowest entries may not be outliers. Scores are 0 when the window has fewer than two sessions.
cost_summary
Model cost and token totals, with a breakdown.
| Input | Type | Description |
|---|---|---|
window | string | Default 24h. |
group_by | string | Breakdown key: model, agent_system or session_id. Default model. |
session_id | string | Limit both the summary and the breakdown to one session. |
{
"window": "720h0m0s",
"group_by": "model",
"summary": {"cost_usd": 10.9496248, "calls": 163, "input_tokens": 450394, "output_tokens": 129679},
"breakdown": [
{"key": "claude-opus-4-7", "cost_usd": 6.997629, "calls": 81, "input_tokens": 8706, "output_tokens": 51182},
{"key": "claude-opus-4-6", "cost_usd": 1.72596, "calls": 40, "input_tokens": 269472, "output_tokens": 41488}
]
}
calls counts model calls. Cost is what the agents report, in US dollars; it is 0 for agents that do not report cost. The breakdown holds up to 200 rows, highest cost first.
risk_feed
Risk flags raised on tool calls, newest first, with a severity for each.
| Input | Type | Description |
|---|---|---|
window | string | Default 24h. |
session_id | string | Only flags in this session. |
severity | string | Only high, medium or low. Any other value returns an error. |
flag | Severity | Raised when a tool call |
|---|---|---|
credential_detected | high | Contains what looks like a secret, such as a cloud access key, an API token or a private key. |
destructive_operation | high | Runs a destructive command, such as a recursive delete, a force push or a hard reset. |
sensitive_path | medium | Touches a sensitive file, such as a .env file, SSH keys or cloud credentials. |
{
"window": "24h0m0s",
"count_by_severity": [
{"severity": "high", "count": 2},
{"severity": "medium", "count": 1}
],
"events": [
{
"timestamp": "2026-10-05T14:02:11.031Z",
"session_id": "5e551011-0000-4000-8000-000000000001",
"tool_call_id": "toolu_01AbCdEfGhIjKlMnOpQrStUv",
"tool_name": "Bash",
"flag": "destructive_operation",
"severity": "high",
"evidence": "rm recursive/force"
}
]
}
count_by_severity lists severities from high to low and covers the whole window with the same session_id and severity filters, not only the events returned. events holds up to 200 flags. evidence is a short description of what matched: the path for sensitive_path, the kind of command for destructive_operation, or the kind of credential and its first few characters for credential_detected. tool_call_id is the agent’s own id for the call; to see the full call, run get_session for the session and find the tool call with the same tool_call_id.
external_domains
Hosts found in your agents’ tool-call arguments (fetched URLs, curl and wget targets, and URL arguments of MCP tools), most-referenced first.
| Input | Type | Description |
|---|---|---|
window | string | Default 24h. |
session_id | string | Only hosts referenced in this session. |
{
"window": "720h0m0s",
"domains": [
{"host": "github.com", "count": 12, "first_seen": "2026-09-15T16:21:24.573749Z", "last_seen": "2026-09-22T13:54:48.385442Z"}
]
}
count is the number of references to the host, and first_seen and last_seen bound them within the window. The list holds up to 200 hosts.