Skip to main content
Glama

netmiko.query_audit_trail

Audit past SSH connections and command executions on network devices. Filter by device, tool, outcome, or event to trace who ran what and why.

Instructions

Read the audit trail: what this server was asked to do, and what happened.

Answers questions about PAST activity — "everything done on SW-CORE-01", "the last 6 netmiko actions", "which commands were refused this week", "who touched that switch and with which credential". It reads the audit records only; it never opens a connection and never returns device output.

Every argument is a filter, combined with AND. Leave one empty to not filter on it. Translate what the user asked into these arguments — do not ask for everything and sift through it.

The audit trail rotates daily and this reads the rotated files too, but only what is still on disk. files_scanned and oldest_available in the response say how far back the answer actually reaches: if the period the user asked about is older than that, say so instead of reporting "nothing happened".

matched is how many records satisfied the filters; returned is how many came back in this call. When they differ, the response is one page — never report returned as a total.

Calling this tool writes a tool_invocation record of its own — reading the trail is itself auditable — but those records are hidden from the results by default, so "the last 6 actions" is about the network and not about your own questions. audit_queries_hidden says how many were left out.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNoFull tool name, e.g. 'netmiko.send_show_command'.
eventNoRecord type. One of command_attempt (a command was validated), connection_outcome (an SSH attempt finished), tool_invocation (a tool that touches no device was called), credential_resolution (which credential was used).
limitNoMaximum records to return. Defaults to 50, capped at 500.
orderNo'desc' (newest first, the default) or 'asc'.desc
sinceNoISO 8601 date or datetime, UTC. '2026-08-17' means from midnight.
untilNoISO 8601 date or datetime, UTC.
deviceNoExact inventory device name, as netmiko.list_devices returns it.
reasonNoWhy a command was allowed or refused, e.g. DENY_MATCH, NO_ALLOW_MATCH.
outcomeNoHow an execution ended, e.g. SUCCESS, AUTH_FAILURE, TIMEOUT. Only connection_outcome records carry it.
verdictNoALLOWED or DENIED. Only command_attempt records carry it.
summary_byNoReturn counts instead of records, grouped by one of device, tool, outcome, verdict, event, day. Counts are exact over every matching record, not over one page. Use it for "how many" questions so a count does not cost hundreds of records. Combine it with an `event` filter to avoid a large '(absent)' bucket: records of one type do not carry the fields of another.
correlation_idNoTies the validation, the credential and the outcome of one single attempt together. Use it to reconstruct what happened in one case.
command_containsNoCase-insensitive substring of the command, e.g. 'running-config'.
include_audit_queriesNoInclude this tool's own invocations. Defaults to False. Set it to True only when the question is about who read the audit trail.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses all behavioral traits: it only reads records, never connects to devices, filters combine with AND, audit trail rotates and reads available files, response fields indicate coverage and pagination, and it records its own invocations which are hidden by default. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose. Each sentence adds unique value: examples of use, filtering rules, disk rotation caveats, response field semantics, and self-auditing behavior. No wasted words; the length is appropriate for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (14 parameters, no annotations, but has output schema), the description covers all necessary aspects: purpose, usage guidance, filtering, pagination, audit trail rotation, and self-recording. It is sufficiently complete for an agent to invoke correctly without additional help.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes all 14 parameters with complete descriptions (100% coverage). The description adds value beyond the schema by explaining the combined-AND filtering strategy, pagination behavior (matched vs. returned), and the context for include_audit_queries. This is meaningful but not extensive, so a 4 is warranted.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads the audit trail of past activity, with examples of questions it answers. It distinguishes itself from siblings like send_show_command and read_device_output by explicitly noting it never opens a connection or returns device output.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives strong guidance on when to use the tool (for past activity, not current state) and how to translate user questions into arguments. It instructs to avoid requesting all records and sifting through them. However, it does not explicitly name sibling alternatives to use instead, leaving the agent to infer from context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/escrimaglia/netmiko-sot_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server