grafana-log-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_datasourcesA | 列出该 Grafana 实例上全部 Loki 日志数据源(uid/名称/是否默认),以及各数据源已登记的项目数。多数据源环境下先用它确认要查哪个数据源。 |
| list_projectsA | 列出全部可查项目:已登记项目(含中文别名)+ 遍历各 Loki 数据源实时发现的 app/group 组合(默认查最近 24h,标注归属数据源与登记状态)。不知道项目叫什么时先调这个。 |
| list_labelsB | 列出某数据源(或某项目)在时间窗内可用的日志标签名(如 app/group/host/level)。 |
| list_label_valuesC | 列出指定标签在时间窗内的全部取值(如 labelName=app 列出所有服务名)。 |
| query_logsA | 查询原始日志。数据量控制:优先用 requestId 精确到单次请求;配合窄时间窗(默认 15m);行数/单行长度/总响应均有硬上限,超出会标注省略。排查线上问题建议优先用 diagnose_issue(自动聚合分析),本工具适合按线索精确取证。 |
| get_full_lineA | 取回日志完整原始行(不做单行截断):query_logs/trace_context 返回的行带"(截断 N 字符)"标记时,把该行的 time 作为 timestamp(配合 keyword)调本工具取回完整内容。 |
| query_slow_logsA | 按耗时阈值抓取慢日志(如执行超过 30s 的慢 SQL)。支持三个维度:sql(每条 SQL 的 queryRows/updateRows Nms)、request(请求级 utime)、connection(连接级 release)。慢 SQL 自动按连接号-序号配对回捞语句原文;命中超 30 条(如循环任务)时自动按操作聚合统计(count/totalMs/maxMs/avgMs),明细仅保留最慢样本。 |
| summarize_errorsA | 错误聚合归并:把窗口内错误按模板指纹压缩成少量模式,区分首发错误(可能的原因)与级联噪声(后果),并给出故障类型分类、堆栈业务帧、高频 requestId。比直接翻错误日志高效得多。 |
| logs_volumeC | 日志量级趋势与突增检测:分桶计数 + 相对基线的突增倍数 + 异常起始时刻。回答"什么时候开始出问题"。 |
| trace_contextA | 按 requestId/traceId 还原单次请求的完整日志链路(时间正序)。定位具体一次失败请求时用它,返回量小且完整。 |
| compare_baselineA | 与基线窗对比("日志都正常但结果不对"时的首选):找出消失的日志模板(静默跳过信号)、新出现的模板、数值偏离(逻辑 bug 信号)、字段取值分布突变。默认对比前一天同时段。 |
| inspect_fieldsA | 字段取值与空值探测("变量没设置"时的首选):统计字段空值率、命中"使用默认值/未配置/fallback"的日志样本。 |
| trace_flowA | 流程完整性检查("流程走一半没了但不报错"时的首选):取一条链路的日志模板序列,与成功样本序列对比,定位流程在哪一步中断。 |
| diagnose_issueA | 【排障首选】一次调用完成完整根因分析:量级趋势→异常定位→双路径探测(错误突增归并分类 + 无报错基线对比/空值探测/流程断点)→候选原因打分。返回带证据链的诊断报告 + codeHints(供在当前代码仓库中检索定位)。不传 project 则跨全部数据源扫描找疑似源头。 |
| build_explore_urlC | 生成 Grafana Explore 深链:AI 给出结论后,人可一键跳到 Grafana 亲自核对原始日志。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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/sunshinerich/grafana-log-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server