Use this prompt when working with AI agents to help them understand and use logdump:
You have access to logdump, a log streaming and viewing tool. Here's how to use it effectively:
logdump -mcp -config logdump.yamlAlways set your agent identity first:
{
"method": "logdump/set_agent",
"params": {
"agent_id": "unique-agent-id",
"agent_name": "Your Name"
},
"id": 1
}{
"method": "tools/call",
"params": {
"name": "logdump_streams",
"arguments": {}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_groups",
"arguments": {}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_read",
"arguments": {
"source": "app", // optional: filter by stream name
"group": "errors", // optional: filter by group name
"limit": 100 // optional: max entries (default 100)
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_grep",
"arguments": {
"pattern": "ERROR.*connection",
"source": "app", // optional: filter by stream name
"group": "errors", // optional: filter by group name
"limit": 50, // optional
"case_insensitive": true // optional
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_create_group",
"arguments": {
"name": "database-errors",
"pattern": "ERROR.*database|connection.*failed",
"color": "red",
"streams": "app,api,database"
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_access_log",
"arguments": {
"agent": "Claude", // optional: filter by agent
"limit": 50 // optional
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_stats",
"arguments": {}
}
}You can also read logs as resources:
{
"method": "resources/list",
"id": 1
}{
"method": "resources/read",
"params": {
"uri": "logdump://stream/app"
},
"id": 2
}{
"method": "resources/read",
"params": {
"uri": "logdump://group/errors"
},
"id": 3
}// 1. Set identity
{"method": "logdump/set_agent", "params": {"agent_id": "debug-001", "agent_name": "Claude"}, "id": 1}
// 2. Check available streams
{"method": "tools/call", "params": {"name": "logdump_streams", "arguments": {}}, "id": 2}
// 3. Search for errors in the last hour
{"method": "tools/call", "params": {"name": "logdump_grep", "arguments": {"pattern": "ERROR", "limit": 50}}, "id": 3}
// 4. Get a specific stream's logs
{"method": "tools/call", "params": {"name": "logdump_read", "arguments": {"source": "app", "limit": 20}}, "id": 4}
// 5. Create a group for database issues
{"method": "tools/call", "params": {"name": "logdump_create_group", "arguments": {"name": "db-issues", "pattern": "database|connection|timeout", "color": "red", "streams": "app"}}, "id": 5}
// 6. Read logs from a group resource
{"method": "resources/read", "params": {"uri": "logdump://group/db-issues"}, "id": 6}
// 7. View who accessed logs recently
{"method": "tools/call", "params": {"name": "logdump_access_log", "arguments": {"limit": 20}}, "id": 7}- Each line in a log file = one log entry - Multi-line messages appear as separate entries
- Groups filter by regex pattern - Use
|for OR,.*for wildcards - Agent actions are tracked - All access is logged with timestamps
- Case-insensitive search: Use
"case_insensitive": truein grep - Groups combine multiple streams - Useful for viewing related logs together
- Resources provide log content - Use
resources/readto get formatted log output
streams:
- name: app
path: /var/log/app
patterns: ["*.log"]
color: cyan
- name: nginx
path: /var/log/nginx
patterns: ["access.log", "error.log"]
color: yellow
groups:
- name: errors
pattern: "ERROR|FATAL|ERR"
color: red
streams:
- app
- nginx
- name: web
pattern: ""
streams:
- nginx- No streams visible? - Check the log files exist and are readable
- Empty results? - Try increasing
limitor check your pattern - Groups not working? - Ensure streams are correctly named in config
- Resources return empty? - Wait a moment for logs to be read into buffer
Always set your agent identity first:
{
"method": "logdump/set_agent",
"params": {
"agent_id": "unique-agent-id",
"agent_name": "Your Name"
},
"id": 1
}{
"method": "tools/call",
"params": {
"name": "logdump_streams",
"arguments": {}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_groups",
"arguments": {}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_read",
"arguments": {
"source": "app", // optional: filter by stream name
"group": "errors", // optional: filter by group name
"limit": 100 // optional: max entries (default 100)
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_grep",
"arguments": {
"pattern": "ERROR.*connection",
"source": "app", // optional
"group": "errors", // optional
"limit": 50, // optional
"case_insensitive": true // optional
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_create_group",
"arguments": {
"name": "database-errors",
"pattern": "ERROR.*database|connection.*failed",
"color": "red",
"streams": "app,api,database"
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_access_log",
"arguments": {
"agent": "Claude", // optional: filter by agent
"limit": 50 // optional
}
}
}{
"method": "tools/call",
"params": {
"name": "logdump_stats",
"arguments": {}
}
}// 1. Set identity
{"method": "logdump/set_agent", "params": {"agent_id": "debug-001", "agent_name": "Claude"}, "id": 1}
// 2. Check available streams
{"method": "tools/call", "params": {"name": "logdump_streams", "arguments": {}}, "id": 2}
// 3. Search for errors in the last hour
{"method": "tools/call", "params": {"name": "logdump_grep", "arguments": {"pattern": "ERROR", "limit": 50}}, "id": 3}
// 4. Get a specific stream's logs
{"method": "tools/call", "params": {"name": "logdump_read", "arguments": {"source": "app", "limit": 20}}, "id": 4}
// 5. Create a group for database issues
{"method": "tools/call", "params": {"name": "logdump_create_group", "arguments": {"name": "db-issues", "pattern": "database|connection|timeout", "color": "red", "streams": "app"}}, "id": 5}
// 6. View who accessed logs recently
{"method": "tools/call", "params": {"name": "logdump_access_log", "arguments": {"limit": 20}}, "id": 6}- Each line in a log file = one log entry - Multi-line messages appear as separate entries
- Groups filter by regex pattern - Use
|for OR,.*for wildcards - Agent actions are tracked - All access is logged with timestamps
- Case-insensitive search: Use
"case_insensitive": truein grep - Groups combine multiple streams - Useful for viewing related logs together
streams:
- name: app
path: /var/log/app
patterns: ["*.log"]
color: cyan
- name: nginx
path: /var/log/nginx
patterns: ["access.log", "error.log"]
color: yellow
groups:
- name: errors
pattern: "ERROR|FATAL|ERR"
color: red
streams:
- app
- nginx
- name: web
pattern: ""
streams:
- nginx- No streams visible? - Check the log files exist and are readable
- Empty results? - Try increasing
limitor check your pattern - Groups not working? - Ensure streams are correctly named in config