mcp-lnav-canbus
MCP lnav CAN bus Server
A Model Context Protocol (MCP) server that exposes lnav log file analysis capabilities to AI assistants, specifically optimized for Kvaser Plain Text Log Frame CAN bus log processing.
Overview
This Python-based MCP server provides session-based access to CAN bus log files with structured JSON output, enabling AI models to analyze, query, and extract insights from Kvaser CAN bus logs through the Model Context Protocol.
Related MCP server: Wireshark MCP Server
Architecture
┌─────────────────────┐ ┌──────────────────────┐ ┌─────────────────┐
│ MCP Client │────▶│ MCP Server │────▶│ lnav CLI │
│ (Claude, Cursor) │◀────│ (Python, stdio) │◀────│ (v0.12.0+) │
└─────────────────────┘ └──────────────────────┘ └─────────────────┘
│
▼
┌──────────────────────┐
│ Session Manager │
│ (stateful context) │
└──────────────────────┘
│
▼
┌──────────────────────┐
│ Kvaser CAN Logs │
│ (.txt, .log) │
└──────────────────────┘Requirements
Runtime Dependencies
Python: 3.10 or higher
lnav: 0.12.0 or higher (must be installed and available in PATH)
MCP Python SDK: 2.0.0+ (v2 beta) or 1.27+ (v1 stable)
Supported Log Format
Primary Format: Kvaser Plain Text Log Frame
# Column format: Timestamp Channel Type Dir ID DLC Data
0.000000 0 Rx std 0x123 8 00 01 02 03 04 05 06 07
0.001000 0 Tx std 0x456 8 AA BB CC DD EE FF 00 11Also Supported (via lnav auto-detection):
Vector ASC
CANalyzer TRC
Generic CSV with timestamp/channel/id/data columns
Installation
1. Install lnav
# macOS
brew install lnav
# Ubuntu/Debian
sudo apt-get install lnav
# Or download from https://github.com/tstack/lnav/releasesVerify installation:
lnav --version2. Install the MCP Server
# Using pip
pip install mcp-lnav-canbus
# Using uv
uv add mcp-lnav-canbusConfiguration
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"lnav-canbus": {
"command": "python",
"args": ["-m", "mcp_lnav_canbus"],
"env": {
"LNAV_PATH": "/usr/local/bin/lnav"
}
}
}
}Cursor
.cursor/mcp.json in project root:
{
"mcpServers": {
"lnav-canbus": {
"command": "python",
"args": ["-m", "mcp_lnav_canbus"],
"cwd": "/path/to/your/project",
"env": {
"LNAV_PATH": "/usr/local/bin/lnav"
}
}
}
}VS Code (with MCP extension)
.vscode/mcp.json:
{
"servers": {
"lnav-canbus": {
"type": "stdio",
"command": "python",
"args": ["-m", "mcp_lnav_canbus"]
}
}
}Tools
open_can_log
Open a Kvaser CAN bus log file in the current session.
Parameters:
file_path(string, required): Path to the Kvaser CAN log filesession_id(string, optional): Session identifier (auto-generated if not provided)
Example:
{
"name": "open_can_log",
"arguments": {
"file_path": "/data/can_trace.txt"
}
}Response:
{
"success": true,
"session_id": "sess_abc123",
"file_info": {
"path": "/data/can_trace.txt",
"format": "kvaser",
"message_count": 15420,
"time_range": {
"start": "2024-01-15T10:00:00.000000",
"end": "2024-01-15T10:05:30.123456"
},
"channel_count": 2,
"unique_ids": 47
}
}query_can_messages
Execute SQL queries against CAN bus log data using lnav's SQL engine.
Parameters:
query(string, required): SQLite query to executelimit(integer, optional, default: 100): Maximum rows to return
Example:
{
"name": "query_can_messages",
"arguments": {
"query": "SELECT can_id, COUNT(*) as count FROM log GROUP BY can_id ORDER BY count DESC LIMIT 10"
}
}Response:
{
"success": true,
"columns": ["can_id", "count"],
"rows": [
["0x123", 1542],
["0x456", 987],
["0x789", 654]
],
"row_count": 3,
"execution_time_ms": 45
}extract_can_frames
Extract specific CAN frames by ID, channel, or time range.
Parameters:
can_id(string, optional): CAN ID to filter (hex format, e.g., '0x123')channel(integer, optional): CAN channel number (0-based)start_time(string, optional): Start timestampend_time(string, optional): End timestamplimit(integer, optional, default: 1000): Maximum frames to return
Example:
{
"name": "extract_can_frames",
"arguments": {
"can_id": "0x123",
"start_time": "0.000000",
"end_time": "1.000000",
"limit": 100
}
}Response:
{
"success": true,
"frames": [
{
"timestamp": "0.000000",
"channel": 0,
"type": "Rx",
"can_id": "0x123",
"dlc": 8,
"data": [0, 1, 2, 3, 4, 5, 6, 7]
}
],
"frame_count": 1,
"total_matching": 154
}get_statistics
Generate statistical analysis of CAN bus traffic.
Parameters:
stat_type(string, required): "frequency", "timing", "load", "errors", or "summary"interval(string, optional): Time interval for aggregation (e.g., '1s', '100ms')can_id(string, optional): CAN ID to filter statistics
Example:
{
"name": "get_statistics",
"arguments": {
"stat_type": "frequency",
"interval": "1s"
}
}Response:
{
"success": true,
"stat_type": "frequency",
"statistics": {
"by_id": [
{"can_id": "0x123", "count": 1542, "rate_hz": 100.0},
{"can_id": "0x456", "count": 987, "rate_hz": 64.2}
],
"total_messages": 15420,
"duration_seconds": 330.123456,
"average_rate_hz": 46.7
}
}find_errors
Find error frames and anomalies in CAN bus logs.
Parameters:
error_type(string, optional, default: "all"): "all", "crc", "bit", "stuff", "form", "ack", "timeout", or "gap"channel(integer, optional): Channel filter
Example:
{
"name": "find_errors",
"arguments": {
"error_type": "crc"
}
}Response:
{
"success": true,
"errors": [
{
"timestamp": "1.234567",
"channel": 0,
"error_type": "crc",
"can_id": "0x123",
"message": "CRC error detected"
}
],
"error_count": 1,
"error_rate_per_minute": 0.18
}analyze_payload_noise
Analyze CAN bus payload repetition to detect noise in logs using MD5 hashes. This tool identifies repeated payloads that may represent noise or meaningless data in the log.
Parameters:
min_repetitions(integer, optional, default: 10): Minimum number of repetitions to consider as noisesession_id(string, optional): Session identifier
Example:
{
"name": "analyze_payload_noise",
"arguments": {
"min_repetitions": 5
}
}Response:
{
"success": true,
"analysis": {
"total_frames": 1000,
"unique_payloads": 25,
"noise_patterns_found": 3,
"total_noisy_frames": 850,
"noise_percentage": 85.0,
"min_repetitions_threshold": 5
},
"noise_patterns": [
{
"payload_md5": "0ee0646c1c77d8131cc8f4ee65c7673b",
"repetition_count": 500,
"payload_hex": "01 02 03 04 05 06 07 08",
"first_timestamp": "0.000000",
"last_timestamp": "10.500000",
"time_span_seconds": 10.5,
"can_ids": ["0x123"],
"channels": [0],
"noise_ratio": 0.5
}
]
}scan_payload_for_value
Scan CAN bus payload bytes for a specific decimal value. Searches for frames where consecutive bytes in the payload match the binary representation of the given decimal value. Supports both big-endian and little-endian byte orders.
Parameters:
byte_value(integer, required): Decimal value to search for (0 to unlimited, auto-calculates byte width)endianness(string, optional, default: "big"): Byte order ("big" or "little")start_offset(integer, optional, default: 0): Start searching from this byte offsetend_offset(integer, optional, default: None): Stop searching at this byte offset (None searches to end)limit(integer, optional, default: 1000): Maximum frames to returnsession_id(string, optional): Session identifier
Example:
{
"name": "scan_payload_for_value",
"arguments": {
"byte_value": 65535,
"endianness": "big",
"limit": 10
}
}Response:
{
"success": true,
"search_criteria": {
"byte_value": 65535,
"endianness": "big",
"start_offset": 0,
"end_offset": null,
"byte_width": 2,
"target_bytes_hex": "FF FF"
},
"matches": [
{
"timestamp": "0.001000",
"channel": 0,
"type": "Tx",
"direction": "std",
"can_id": "0x456",
"dlc": 8,
"data": [170, 187, 255, 255, 238, 239, 0, 17],
"payload_hex": "AA BB FF FF EE EF 00 11",
"match_position": 2,
"match_bytes": [255, 255],
"byte_width": 2
}
],
"match_count": 1,
"frames_scanned": 10,
"frames_skipped_too_short": 0
}Use Cases:
Find frames containing specific sensor values (e.g., temperature = 255)
Search for error codes encoded in payload bytes
Locate frames with specific multi-byte values (e.g., 16-bit counters, 32-bit timestamps)
Debug communication issues by finding frames with unexpected byte patterns
get_session_info
Retrieve information about the current session state.
Parameters: None
Response:
{
"success": true,
"session_id": "sess_abc123",
"files_loaded": [
{
"path": "/data/can_trace.txt",
"format": "kvaser",
"message_count": 15420,
"loaded_at": "2024-01-15T14:30:00Z"
}
],
"active_filters": [],
"lnav_version": "0.12.0",
"session_duration_seconds": 120
}close_session
Close the current session and release resources.
Parameters: None
Response:
{
"success": true,
"session_id": "sess_abc123",
"message": "Session closed successfully"
}Resources
The server provides the following MCP resources:
canbus://session/{session_id}/log
Access the current session's loaded log file content.
Example URI: canbus://session/sess_abc123/log
canbus://session/{session_id}/messages/{can_id}
Access specific CAN ID messages from the session.
Example URI: canbus://session/sess_abc123/messages/0x123
canbus://session/{session_id}/errors
Access error frames from the session's log file.
Example URI: canbus://session/sess_abc123/errors
Prompts
canbus-analyze
Generate a comprehensive analysis of a Kvaser CAN bus log file.
Parameters:
file_path(string, required): Path to the Kvaser CAN log fileanalysis_type(string, optional): "quick", "detailed", "errors", "traffic", or "custom" (default: "detailed")focus_ids(array, optional): List of CAN IDs to focus analysis on
Example:
/canbus-analyze file_path="/data/can_trace.txt" analysis_type="detailed"canbus-decode-frame
Help decode and interpret a specific CAN frame.
Parameters:
can_id(string, required): CAN ID to decodedata_bytes(array, required): Data bytes to decodedbc_file(string, optional): Path to DBC file for signal decoding
Example:
/canbus-decode-frame can_id="0x123" data_bytes=[0,1,2,3,4,5,6,7]Session Lifecycle
Session Creation
Client initiates MCP connection via stdio
Server creates session context with unique session ID
Server spawns lnav process for the session
Session state initialized (empty file list, no filters)
Session Usage
Client calls
open_can_logto load a fileServer loads file into lnav, updates session state
Client makes queries using session context
Server maintains lnav process and state between calls
Session Termination
Client calls
close_sessionor disconnectsServer terminates lnav process
Server releases session resources
Session state cleared
Server Configuration
Transport
Transport Protocol: stdio only
The server communicates via standard input/output streams, suitable for local CLI integration and subprocess spawning.
Session Management
The server maintains session-based state between calls:
Each client connection establishes a session context
Session persists for the lifetime of the MCP connection
Loaded files remain in session memory for subsequent queries
Session state includes: loaded files, active filters, query history, lnav process handle
Path Validation
Pass-through to lnav: The server does not validate file paths. Path validation and error handling is delegated to lnav, which returns appropriate error messages for invalid paths.
Environment Variables
Variable | Description | Default |
| Path to lnav binary |
|
| Default timeout for lnav operations (seconds) |
|
| Maximum concurrent sessions |
|
| Logging verbosity |
|
Server Startup
# Basic usage
python -m mcp_lnav_canbus
# With custom lnav path
LNAV_PATH=/usr/local/bin/lnav python -m mcp_lnav_canbus
# With debug logging
LOG_LEVEL=DEBUG python -m mcp_lnav_canbusError Handling
Error Response Format
{
"success": false,
"error": {
"code": "FILE_NOT_FOUND",
"message": "File not found: /path/to/log.txt",
"details": {
"path": "/path/to/log.txt",
"lnav_error": "Unable to open file"
}
}
}Error Codes
Code | Description |
| Specified file path does not exist |
| Log file format not recognized |
| SQL query syntax error |
| Session not found or expired |
| lnav process error |
| Operation timed out |
| Internal server error |
Usage Examples
Example 1: Basic Log Analysis
// Request
{
"tool": "open_can_log",
"arguments": {
"file_path": "/data/can_trace.txt"
}
}
// Response
{
"success": true,
"session_id": "sess_abc123",
"file_info": {
"path": "/data/can_trace.txt",
"format": "kvaser",
"message_count": 15420,
"time_range": {
"start": "2024-01-15T10:00:00.000000",
"end": "2024-01-15T10:05:30.123456"
},
"channel_count": 2,
"unique_ids": 47
}
}Example 2: Query by CAN ID
// Request
{
"tool": "query_can_messages",
"arguments": {
"query": "SELECT can_id, COUNT(*) as count FROM log GROUP BY can_id ORDER BY count DESC LIMIT 10"
}
}
// Response
{
"success": true,
"columns": ["can_id", "count"],
"rows": [
["0x123", 1542],
["0x456", 987],
["0x789", 654]
],
"row_count": 3
}Example 3: Error Detection
// Request
{
"tool": "find_errors",
"arguments": {
"error_type": "all"
}
}
// Response
{
"success": true,
"errors": [
{
"timestamp": "1.234567",
"channel": 0,
"error_type": "crc",
"can_id": "0x123",
"message": "CRC error detected"
}
],
"error_count": 1,
"error_rate_per_minute": 0.18
}Security Considerations
Server runs with same permissions as host process
File access limited to paths provided in tool calls
No network access performed (stdio transport only)
SQL queries executed in sandboxed lnav session
Session isolation prevents cross-session data access
Command injection prevented via parameterized queries
Troubleshooting
Common Issues
lnav not found:
Error: LNAV_PATH not set or lnav not in PATH
Solution: Set LNAV_PATH environment variable or install lnavInvalid log format:
Error: INVALID_FORMAT
Solution: Ensure log file is Kvaser Plain Text Log Frame formatSession timeout:
Error: SESSION_ERROR
Solution: Check session_id is valid and session hasn't expiredQuery syntax error:
Error: QUERY_ERROR
Solution: Verify SQLite syntax in query parameterPerformance Considerations
Large log files indexed on open (progress reported to client)
SQL queries executed via lnav's SQLite integration
Result limiting prevents memory exhaustion
Timeout enforcement prevents hung operations
Limitations
Binary formats (BLF, MF4) require external conversion tools
Real-time log tailing is not supported (batch processing only)
DBC signal decoding requires external DBC parser integration
Maximum file size recommendations apply for performance
Development
Running in Development Mode
Use the MCP Inspector to test the server:
uv run mcp dev server.pyTesting
# Run tests
pytest tests/
# Run with coverage
pytest --cov=mcp_lnav_canbus tests/Version Compatibility
Component | Minimum Version | Recommended Version |
Python | 3.10 | 3.11+ |
lnav | 0.12.0 | 0.14.0+ |
MCP SDK | 1.27.0 or 2.0.0b1 | 2.0.0b1+ |
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
lnav - Log File Navigator by Timothy Stack
Model Context Protocol - MCP specification
MCP Python SDK - Python implementation
Resources
Available Tools
9 toolsanalyze_payload_noiseA
Analyze CAN bus payload repetition to detect noise in logs.
Uses MD5 hashes of payload data to identify repeated payloads that may represent noise or meaningless data in the log.
Args: min_repetitions: Minimum number of repetitions to consider as noise (default: 10) session_id: Session identifier
Returns: Analysis of payload repetition and potential noise patterns
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | ||
| min_repetitions | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the method (uses MD5 hashes) and the goal (identify repeated payloads that may represent noise). It does not mention side effects, but as an analysis tool this is likely read-only, so the description provides adequate transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is succinct and front-loaded with the core purpose. It follows a clear structure: summary, method, args, returns, with no filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists and sibling tools like open_can_log and get_session_info provide session context, the description is mostly complete. It could mention that a session must already be open, but the session_id parameter adequately implies this.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains min_repetitions well ('Minimum number of repetitions to consider as noise') and notes the default of 10. However, session_id is only described as 'Session identifier', lacking context on how to obtain or use it, which leaves a gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Analyze CAN bus payload repetition to detect noise in logs', which is a specific verb (analyze) and resource (payload repetition). This distinguishes it from sibling tools like query_can_messages and scan_payload_for_value, which focus on querying or scanning specific values.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when analyzing CAN logs for noise, and the mention of 'noise' sets it apart from alternatives. However, it does not explicitly state when not to use this tool or name alternative tools, so exclusions are missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
close_sessionA
Close the current session and release resources.
Args: session_id: Session identifier (uses most recent if not provided)
Returns: Confirmation message
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden, and it does disclose that resources are released and that it returns a confirmation message. However, it omits details such as whether the operation is reversible, error behavior if no session exists, or any side effects on other tools.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with Args and Returns sections. Every sentence adds value, and there is no redundant content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool, the description covers purpose, argument semantics, and return value. However, the absence of annotation safety details and explicit side effects leaves minor gaps that prevent a perfect score.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema only defines session_id with a default of null and no description; the description adds critical meaning by stating 'Session identifier (uses most recent if not provided),' clarifying the optional behavior. This compensates for the 0% schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Close the current session and release resources' with a specific verb and resource. This distinguishes it from siblings like open_can_log and other session-related tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., after open_can_log) or when not to use it, leaving the agent to infer from the name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extract_can_framesA
Extract specific CAN frames by ID, channel, or time range.
Args: can_id: CAN ID to filter (hex format, e.g., '0x123') channel: CAN channel number (0-based) start_time: Start timestamp end_time: End timestamp limit: Maximum frames to return (default: 1000) session_id: Session identifier
Returns: List of CAN frames
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| can_id | No | ||
| channel | No | ||
| end_time | No | ||
| session_id | No | ||
| start_time | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It adds some context, such as 'Maximum frames to return' for limit and 'hex format' for can_id, but it does not explain timestamp formats, session_id semantics, or behavior when no filters are applied. This is a moderate effort.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a well-structured docstring with a concise summary sentence, labeled Args section, and Returns section. It is appropriately sized with no unnecessary fluff, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 6 optional parameters and an output schema, and the description gives enough to attempt a call. However, it leaves significant gaps: timestamp format is unspecified, session_id is unexplained, and there is no context about how filters combine or what happens with no filters. It is adequate but not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The Args section provides a description for every parameter, adding meaning beyond the schema which has no descriptions. It includes helpful details like hex format for can_id and default value for limit, though some descriptions are terse (e.g., 'Start timestamp' without format).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Extract specific CAN frames by ID, channel, or time range,' which uses a specific verb and resource. However, it does not differentiate from the sibling tool 'query_can_messages', so it lacks explicit sibling distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when filtering by ID, channel, or time range, but it provides no explicit guidance on when to use this tool versus alternatives like 'query_can_messages'. There are no stated exclusions or alternative recommendations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_errorsA
Find error frames and anomalies in CAN bus logs.
Args: error_type: Type of error ("all", "crc", "bit", "stuff", "form", "ack", "timeout", "gap") channel: Optional channel filter session_id: Session identifier
Returns: List of error frames
| Name | Required | Description | Default |
|---|---|---|---|
| channel | No | ||
| error_type | No | all | |
| session_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states that the tool 'Returns a list of error frames' but does not mention whether it is read-only, requires an open session, or has side effects. This lack of explicit safety and side-effect disclosure is a significant gap, similar to the update_drive example.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured, with a one-line summary followed by clearly labeled Args and Returns sections. Every sentence serves a purpose, and the format is front-loaded with the main purpose. No extraneous information is present.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the main purpose, all parameters, and return type, but it lacks important context about tool invocation, such as session prerequisites (e.g., requiring an open session) and when to choose this tool over siblings. While the output schema exists, the description does not explain how sessions are managed or what constitutes an 'anomaly.' This incomplete guidance leaves gaps for a moderately complex tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides no parameter descriptions (coverage 0%), so the description compensates by explaining all three parameters in the 'Args' section. It lists valid values for error_type, marks channel as an optional filter, and describes session_id as a session identifier. This adds meaningful detail beyond the bare schema, though it does not fully explain every term (e.g., 'gap' or 'timeout').
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb and resource: 'Find error frames and anomalies in CAN bus logs.' It also lists specific error types, distinguishing it from sibling tools like query_can_messages and extract_can_frames, which target general messages or frame extraction. This makes the tool's unique function unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by describing error-focused filtering, but it does not explicitly state when to use this tool over alternatives. No exclusions or sibling tool comparisons are provided. The error_type parameter list gives additional context but does not offer clear 'use this when' guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_session_infoA
Retrieve information about the current session state.
Args: session_id: Session identifier (uses most recent if not provided)
Returns: Session state information
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description bears the full burden. It implies a read-only operation via 'Retrieve' and adds a useful behavior note: 'uses most recent if not provided.' However, it does not explain error behavior, what happens if no session exists, or what 'session state information' specifically includes, leaving gaps for a simple getter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is remarkably concise: a one-line purpose statement followed by a clear Args/Returns structure. Every sentence earns its place, and the most important information is front-loaded. There is zero redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one optional parameter, output schema present), the description covers the essential aspects: what it does, the parameter's behavior, and a return summary. It omits potential error states and when to use it, but the output schema likely handles return structure, so the description is adequate for a getter.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It does by explaining session_id's purpose ('Session identifier') and its optionality with the default behavior ('uses most recent if not provided'). This adds meaning beyond the raw schema, though it could go further with format constraints or edge cases.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb and resource: 'Retrieve information about the current session state.' It is distinguishable from siblings like query_can_messages or get_statistics, though it does not explicitly differentiate itself, which would warrant a 5. The mention of 'session state' makes the purpose clear without ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention any prerequisites, context, or scenarios where this tool is preferred over siblings like get_statistics or find_errors. The only implicit hint is the name, but that is insufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_statisticsC
Generate statistical analysis of CAN bus traffic.
Args: stat_type: Type of statistics ("frequency", "timing", "load", "errors", "summary") interval: Time interval for aggregation (e.g., '1s', '100ms') can_id: Optional CAN ID to filter statistics session_id: Session identifier
Returns: Statistical data
| Name | Required | Description | Default |
|---|---|---|---|
| can_id | No | ||
| interval | No | ||
| stat_type | Yes | ||
| session_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden of behavioral disclosure. It only says 'Generate statistical analysis' and 'Returns: Statistical data' without detailing side effects, dependencies on an open session, or whether this is a read-only operation. The lack of any behavioral caveats leaves significant transparency gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured: a clear opening sentence followed by a parameter list and a return line. It is not overly verbose, but the 'Returns: Statistical data' line is vague and adds little. Overall, the structure is efficient and avoids unnecessary fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the vague return statement is acceptable, but the description lacks important context like whether a session must already be open, how the statistics relate to message queries, and when to choose this over sibling tools. It covers parameters adequately but leaves usage context incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description compensates for the 0% schema coverage by explaining stat_type with example values, interval with formats, can_id as an optional filter, and session_id as an identifier. However, it does not elaborate on what each stat_type produces, the exact interval format, or the role of session_id beyond 'identifier', so the added meaning is partial.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Generate statistical analysis of CAN bus traffic' — a specific verb and resource. However, it does not explicitly differentiate from sibling tools like analyze_payload_noise or find_errors, which could also involve statistical analysis, so it misses the top score for sibling distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives. The description simply lists arguments and a generic return. There is no mention of context, exclusions, or prerequisites, so the agent gets no help deciding between this and other analysis tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
open_can_logA
Open a Kvaser CAN bus log file in the current session.
Args: file_path: Path to the Kvaser CAN log file session_id: Optional session identifier (auto-generated if not provided)
Returns: File information and session details
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| session_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It mentions session_id auto-generation and return of file info, but does not explain side effects like session state modification, error handling, or permission requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact, front-loaded with the purpose, and organized with Args and Returns sections. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple, and the description covers purpose, parameters, and return info. However, it lacks usage context (e.g., need to open before querying) and behavioral details. The output schema exists, so return details are adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description compensates by explaining file_path as a path to Kvaser CAN log and session_id as a optional auto-generated identifier. This adds meaningful context beyond the schema's type/title.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Open' with a resource 'Kvaser CAN bus log file' and clarifies it's in the current session. This clearly distinguishes it from sibling tools that query/analyze/extract data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit guidance on when to use this tool vs siblings. It implies it's an entry point ('in the current session') but doesn't state prerequisites or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_can_messagesA
Execute SQL queries against CAN bus log data using lnav's SQL engine.
Args: query: SQLite query to execute (use table name 'frames') limit: Maximum rows to return (default: 100) session_id: Session identifier
Returns: Query results with columns and rows
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| session_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full responsibility for disclosing behavioral traits. It mentions the underlying engine (lnav's SQL engine) and returns format ('columns and rows'), but does not disclose side effects, safety, prerequisites (e.g., an open log session), or error behavior. The omission of session_id's role and the requirement for an active session leaves significant behavioral ambiguity.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured: a clear purpose sentence, an args list with brief explanations, and a returns line. Every element serves a purpose, with no unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the basic purpose and parameters, and an output schema exists to define return values. However, it lacks contextual information about session management (e.g., that querying requires an open log session via session_id), and the sibling tools imply a workflow that is not explained. This makes the description moderately complete but with notable gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It provides helpful hints like 'use table name frames' for query, max rows for limit, and 'Session identifier' for session_id, adding value beyond the schema. However, it does not explain how session_id relates to an open session or how to obtain it, leaving its semantics incomplete.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Execute SQL queries against CAN bus log data using lnav's SQL engine.' This is a specific verb (execute) and resource (CAN bus log data), and it distinguishes itself from siblings like open_can_log and extract_can_frames by emphasizing SQL-based querying.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for running SQL queries on CAN bus log data, but it does not explicitly state when to use this tool over alternatives like extract_can_frames or get_statistics, nor does it mention any exclusions. The context suggests SQL ad-hoc queries, but the guidance is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scan_payload_for_valueA
Scan CAN bus payload bytes for a specific decimal value.
Searches for frames where consecutive bytes in the payload match the binary representation of the given decimal value. Supports both big-endian and little-endian byte orders.
Args: byte_value: Decimal value to search for (0 to unlimited, auto-calculates byte width) endianness: Byte order ("big" or "little"), default: "big" start_offset: Start searching from this byte offset (default: 0) end_offset: Stop searching at this byte offset (default: None, searches to end) limit: Maximum frames to return (default: 1000) session_id: Session identifier
Returns: Matching frames with match position and context
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| byte_value | Yes | ||
| end_offset | No | ||
| endianness | No | big | |
| session_id | No | ||
| start_offset | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses matching logic (consecutive bytes, binary representation, endianness), offset handling, and auto-calculated byte width. It lacks explicit mention of side effects, but the read-only nature is evident from the return of matching frames.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The opening sentence is a concise summary, followed by well-structured Args and Returns sections. No fluff or redundancy exists; every line contributes to understanding the tool's operation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all six parameters, matching behavior, and return format. Even though an output schema exists, the description adds useful context about what constitutes a match and the byte-width calculation. It is complete for a search tool with moderate complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has zero descriptions for its properties, but the description's Args block thoroughly explains each parameter (byte_value, endianness, offsets, limit, session_id) with meanings and defaults. This adds significant value beyond the schema and fully compensates for the lack of property descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Scan CAN bus payload bytes for a specific decimal value', using a specific verb+resource. It adds details about binary representation and endianness, distinguishing it from sibling tools like query_can_messages or analyze_payload_noise.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage is implied through the action description, but there is no explicit guidance on when to use this tool vs alternatives or when not to use it. No reference to sibling tools or exclusions is provided, so the context is clear but not explicitly guided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
9 tool updates
v0.1.0- First observed
analyze_payload_noise - First observed
close_session - First observed
extract_can_frames - First observed
find_errors - First observed
get_session_info - First observed
get_statistics - First observed
open_can_log - First observed
query_can_messages - First observed
scan_payload_for_value
TDQS
Most tools have clear distinct purposes, but get_statistics with 'errors' type overlaps with find_errors, and query_can_messages can technically replace extract_can_frames. Overall, session management, analysis, and extraction tools are well-separated.
All tool names follow a consistent verb_noun snake_case pattern (open_can_log, query_can_messages, get_statistics, etc.) with no mixed styles or ambiguous generic verbs.
Nine tools is well within the ideal range for a focused domain. Each tool covers a distinct aspect of CAN bus log analysis without unnecessary bloat or missing essentials.
The toolset covers log opening, SQL querying, frame extraction, payload noise analysis, statistics, error detection, and session lifecycle. Minor gaps exist like export or DBC decoding, but core analysis workflows are fully supported.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for log file analysis. Gives LLMs the ability to efficiently analyze large log files without loading them into context.799MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol server that enables AI assistants to perform network packet analysis, capture, and security operations on a remote machine via Wireshark/tshark.101MIT
- FlicenseAqualityBmaintenanceA headless MCP server that enables AI tools (like Claude Code) to read and analyze serial logs from embedded boards (ESP32, STM32) for firmware debugging, with read-only tools for log retrieval and a built-in web viewer.6-
- AlicenseAqualityBmaintenanceA Model Context Protocol (MCP) server that connects LLMs to vehicle data via the Eclipse Kuksa Databroker, enabling AI assistants to read and write vehicle signals using the standardized COVESA Vehicle Signal Specification.9Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/baxtheman/mcp-lnav-canbus'
If you have feedback or need assistance with the MCP directory API, please join our Discord server