Skip to main content
Glama
LZBiala

oncall-router-mcp

by LZBiala

oncall-router-mcp

一个 MCP 服务器,用它来回答事故中占用开头十分钟的那三个问题的答案:这个归谁管、我应该叫醒谁、最晚在什么时候叫醒,以及 run book 里第一句说要优先试什么。除此之外还有第四个问题,而且多数工具都会答错:此刻我们应该在时钟的哪个位置——它的起算点是从 impact 发生的时刻,而不是从某个人打开 ticket 的时刻。

没有任何阶段时缺的依赖、不需要 API key、不做网络调用、也没有遥测。它只读取一个本地文件;pytest 只有在跑 gates 时才需要。

为什么它存在

升级联系是最典型的知识,散落在三个地方:一个压根不更新的人 Wiki、一个只知道当前班次的轮值工具,以及资历最久那个人的记忆里。凌晨 0 点的珍贵分钟被花在厘清 “到底找哪个人” 上,而不是修东西。

这个工具就是把这些知识放到了一个 agent 够得到的位置,而且显式把时间算明白。代码所带的的设计观点是:升级的时间从有真正影响的时刻算起。一张晚了二十分钟才开的 ticket,并不会白给响应者多出来的二十分钟;而一个从 ticket 创建时间起算的告警工具,则会悄悄地告诉你它就得 “二十分钟是白来的”。

Related MCP server: pagerduty-mcp

四个工具

工具

回答的问题

无法给出答案时

who_owns

哪个团队对应这个服务,并且现在如何联系他们

会直接说不知道,并把近似匹配作为候选给出,而不是当作答案

escalation_path

按顺序应该叫醒谁,每一跳应该在什么分钟被启动

遇到未知 severity 时拒绝,而不是悄悄默认成最轻的那档

playbook

运行手册先把什么做过的检查排在首位

回退到该服务的一般的步骤,并设置 fell_back 字段,让调用方自己知道

impact_clock

当前应该是哪一跳处于生效中,以及有哪些已经超时

必须要显式传一个 now,而且开始时间在未来时直接拒绝

两个工具默认 fail-closed,而不是 fail-open:一个近似答案永远不会被悄悄当作精确结果,因为一个自信的答案是错误的升级路径,比一句诚实的 “我不知道”要付出的代价大得多。

真实录制可以直接看 docs/TRANSCRIPT.md,包括失败路径的产物。CI 每次都会重新生成该文件,如果它跟代码实际跑出来的话不一致,构建就会悬停。

运行它

git clone <this repo> && cd oncall-router-mcp
python -m pip install "pytest>=7"          # the only dependency, and only to run the tests
python -m pytest tests/ -q                 # 40 tests
PYTHONPATH=src python -m oncall_router.server --catalog catalog.toml

要接到 Claude Desktop 或 Claude Code 里,把这个配置加进你的 MCP 客户端,并且注意要写对绝对路径:

{
  "mcpServers": {
    "oncall-router": {
      "command": "python",
      "args": ["-m", "oncall_router.server", "--catalog", "/abs/path/to/catalog.toml"],
      "env": { "PYTHONPATH": "/abs/path/to/oncall-router-mcp/src" }
    }
  }
}

让一个 MCP 客户端去指向这条命令语句。想用自己的数据,直接复制 catalog.toml、改了内容、然后用 --catalog yours.toml 传进去。不需要代码改动:catalog 本来就只是数据,有一种测试就是同一副工具对接两份不一个 catalog 来证明这一点。

catalog 文件

它因放在一个 TOML 文件里:里面记着 services、每个 service 所属 team、带时间刻度的 escalation 链,以及按症状分开的记录手册步骤。无选 TOML 而不是 YAML,是因为 tomllib 在中国标准库里面已经自带了,这样就让整个 catalog 变成了这个仓库依赖保持为零的原因。

别名的用处比表面看着更大。生产期间人们会输入自己记得的名字:gateway、apigw、edge 和 the gateway 都会灵解析到 archived。

这个项目坚定地不做的事

  • 不做实时集成:它不会去读你的事故系统、轮盘系统,或者你的监控器。这些都是每个不同客户要决定的事,后面会安排走在边界另一边。

  • 不做写操作:它永远不会 call 任何人、不会创建任何东西、也不会改任何状态。它只回答问题,最后由真人做决策。

  • 下面 am 这个仓库 panned 「catalog」是用来虚构的。catalog.toml 里的每个 service、team 和 handle 都是敲定的。只要有出现任何一个能暴露这个仓库员工对应关系的内容,测试都就会打断数据构建。

  • 时间计法它只是个约定,不是什么标准——从影响开始算累积的分钟数,链条一路向下一个团队继续流动时也直接转下去。这是个不 “可取的” 出发,但这也只是一个合理的出发点。

  • 不关心成本或延迟数字,因为不存在模型调用。这个服务本体是确定且处于本地的。

门禁

都守在一个 rubric 之上,这个 rubric 在第一行代码之前就停下来过一次。其中值得了解到这些:

  • 每个工具在只能通过一个真实的 client 走 protocol 去响应,而不仅是在测试里作为函数调用跑。

  • 每个工具都用失败路径的测试证明:不了解它时就说不知道,绝不猜。

  • 每个实现还没有出现之前,均已经观测到这些测试必须必然会 fail。

  • 有测试证明了不写任何 code、仅换上另一个 catalog 一个 process 就能干完整一遍,因此真答案完全不同。

  • 己经 commit 的 transcript 必须是 can be regenerated 产出的,否则构建直接 fail。

  • 没有 credentials、没有在本 lient 里有任何网络调用、没有雇主相关的内容,也没有任何第三方 import。这一道门禁通不过。

Available Tools

4 tools
escalation_pathA

Who to wake for this service at this severity, in order, with the minute each hop is due measured from impact start. Refuses an unknown severity rather than defaulting to the quietest one.

ParametersJSON Schema
NameRequiredDescriptionDefault
serviceYes
severityYesA severity defined by the catalog, for example sev1.

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses a non-default behavior ('Refuses an unknown severity rather than defaulting to the quietest one') and describes the output nature (ordered list with minute timings). No other side effects are mentioned, but the tool appears read-only and the disclosure is sufficient for a simple query.

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?

Two concise sentences, front-loaded with the core purpose and output, followed by the refusal behavior. Every word earns its place, with no redundancy or fluff.

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

Completeness4/5

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

For a tool with only 2 simple parameters and no output schema, the description covers the essential return value (who, order, timing) and the key behavioral nuance (refusal on unknown severity). Nothing critical is missing given the tool's simplicity, though explicit error handling for unknown service isn't described.

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?

Schema coverage is 50% (severity has a description, service does not). The description adds significant meaning to severity: it must be a catalog-defined value and unknown ones are refused. Service is only referenced as 'this service' without additional constraints, but the schema already defines it as a string. Overall, the description compensates well for the coverage gap.

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 states a specific query (who to wake) for a defined resource (this service at this severity) and includes output order and timing. It clearly distinguishes from siblings like who_owns (ownership) and impact_clock (timing) by focusing on the escalation path itself.

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

Usage Guidelines3/5

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

The description implies usage ('Who to wake for this service at this severity') but never explicitly says when to use this tool over siblings or when not to use it. No alternatives are named, so an agent must infer from tool names rather than get explicit routing guidance.

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

impact_clockB

Given when impact started, which escalation hop should be active now and which are overdue. Time is measured from impact start rather than ticket creation. Requires an explicit now timestamp: it never assumes the current time.

ParametersJSON Schema
NameRequiredDescriptionDefault
nowYesISO 8601. Required.
serviceYes
severityYes
impact_startYesISO 8601, e.g. 2026-08-23T14:00:00Z

TDQS

B3.3/5.0
Behavior4/5

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 explicitly states that the tool requires an explicit now timestamp and never assumes current time, and that it measures from impact start rather than ticket creation. This is meaningful behavioral context beyond the schema. It does not mention side effects or error conditions, but for a calculation tool this is reasonably transparent.

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 three sentences with no wasted words. It front-loads the purpose, then adds the key behavioral constraint (time basis and explicit now requirement). Each sentence contributes necessary information, making it concise and well-structured.

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

Completeness3/5

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

For a tool with no output schema and no annotations, the description offers the essential purpose and a critical behavioral constraint, but it does not describe the return format, potential error cases, or how severity/service influence the result. It gives enough to understand the intent but lacks detail for full autonomous use.

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

Parameters2/5

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

Schema description coverage is 50%, covering 'now' and 'impact_start' but leaving 'service' and 'severity' undocumented. The description reinforces the meaning of impact_start and now but does not explain the roles of service and severity in determining escalation hops. It fails to compensate for the missing schema descriptions, leaving those parameters ambiguous.

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

Purpose4/5

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

The description clearly states the core function: determining which escalation hop is active and overdue given impact start and a specified now. It also distinguishes time measurement from ticket creation, which is a specific behavioral nuance. However, it does not explicitly differentiate from sibling tools like 'escalation_path' or 'playbook', so it stops short of a 5.

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

Usage Guidelines2/5

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 its siblings. It mentions a constraint (explicit now timestamp) but does not explain when this tool is appropriate or when another might be better. There is no statement of alternatives or exclusion criteria.

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

playbookA

What the runbook says to check first. Falls back to the service's general steps when the symptom is unknown, and says so with fell_back=true.

ParametersJSON Schema
NameRequiredDescriptionDefault
serviceYes
symptomNoOptional, for example latency.

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses a key behavioral trait: when the symptom is unknown, it falls back and reports with fell_back=true. This is valuable and goes beyond simple 'returns steps.' It also implies a read-only operation. However, it does not describe the complete return structure, error handling, or any side effects, though for a read tool this is minor.

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?

Two sentences, no filler. The primary purpose is front-loaded, and the fallback condition is stated concisely with a concrete outcome (fell_back=true). Every word earns its place.

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

Completeness4/5

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

Given two simple parameters and no output schema or annotations, the description provides core information: what it returns conceptually, the fallback condition, and a note about a response field. It omits the exact return payload shape (e.g., list of steps vs. free text), but for a tool this straightforward, it's nearly sufficient. A tiny bit more about the output format would make it a 5.

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

Parameters3/5

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

Schema coverage is 50% (only symptom has a description). The description adds meaning by explaining that a missing/unknown symptom triggers fallback behavior, linking symptom to the fallback logic. It clarifies the role of service indirectly via 'service's general steps.' Yet it does not elaborate on allowed values, format, or examples for either parameter beyond what the schema already states for symptom.

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

Purpose4/5

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

States a specific action and resource: retrieving the first checks from a runbook for a service. The description clearly sets it apart from siblings (ownership, escalation, impact) by focusing on runbook guidance. However, 'what the runbook says to check first' is slightly vague about whether it returns a list, a single item, or a message, so it's not a perfect 5.

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

Usage Guidelines3/5

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

The description implies usage: use this tool when you need the runbook's first steps, and it handles unknown symptoms by falling back to general steps. It does not explicitly name alternatives or state when not to use it (e.g., if you need escalation path, use escalation_path). The fallback behavior is a form of guidance, but it lacks explicit comparisons to sibling tools.

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

who_ownsA

Which team owns a service and how to reach them right now. Accepts the name someone would actually type during an incident, including aliases. Returns found=false with suggestions rather than guessing at a near match.

ParametersJSON Schema
NameRequiredDescriptionDefault
serviceYesService name or alias.

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explicitly states 'Returns found=false with suggestions rather than guessing at a near match,' which is a valuable behavioral trait that helps the agent set expectations. It also implies a read-only lookup (no side effects mentioned), though it does not elaborate on authentication or error conditions. Overall, it adds meaningful behavioral context beyond the schema.

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?

Two concise sentences, front-loaded with the primary purpose. Every clause adds value: the first sentence defines the outcome; the second clarifies input flexibility and the non-guessing behavior. No redundancy or filler.

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

Completeness4/5

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

The tool is simple (one parameter, no output schema), and the description covers purpose, input semantics, and a key behavior (found=false with suggestions). It does not list the exact fields returned (e.g., team name, contact info), but 'how to reach them' implies that. Given the low complexity and lack of annotations, it is reasonably complete, though a bit more detail on the return payload would make it excellent.

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 schema already describes the parameter as 'Service name or alias' with 100% coverage, so the baseline is 3. The description adds nuance by specifying 'the name someone would actually type during an incident,' which gives the agent guidance on the flexibility of input. This extra context—emphasizing natural incident-time phrasing—goes slightly beyond the schema's dry definition, justifying a 4.

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's purpose: 'Which team owns a service and how to reach them right now.' This specifies a verb (owns), a resource (service), and the output (ownership and contact). It distinguishes itself from sibling tools (escalation_path, playbook, impact_clock) implicitly by focusing on ownership rather than escalation steps, runbooks, or timing.

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

Usage Guidelines3/5

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

The description implies usage context—when you need to identify who owns a service—but it does not explicitly contrast with siblings or state when not to use this tool. There is no mention of alternatives like escalation_path or playbook. The behavior note about returning found=false provides some guidance, but it is not a clear when-to-use vs. when-not-to-use directive.

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.

  1. 4 tool updatesv0.1.0
    • First observedescalation_path
    • First observedimpact_clock
    • First observedplaybook
    • First observedwho_owns

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct aspect of incident routing: ownership (who_owns), escalation (escalation_path), response steps (playbook), and timing (impact_clock). There is no overlap in purpose, and the descriptions make boundaries clear.

Naming Consistency4/5

All tool names are lowercase snake_case and are descriptive, but the pattern varies slightly: who_owns is a question-like phrase, while the others are noun compounds. This is a minor inconsistency, but the naming remains intuitive and predictable.

Tool Count5/5

With only 4 tools, the server is tightly scoped to incident routing. Each tool delivers a unique, essential capability without redundancy, making the count ideal for the domain.

Completeness4/5

The tool set covers the core incident routing workflow: identifying ownership, following escalation paths, accessing playbooks, and tracking escalation timing. Minor gaps like incident acknowledgment or status updates exist but are outside the router's stated purpose.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    A
    maintenance
    MCP server for the Rootly incident management platform — alerts, incidents, on-call schedules
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables PagerDuty incident response operations including listing incidents, acknowledging and resolving incidents, looking up on-call schedules, and listing services.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Self-hosted operational dashboard and MCP server that catalogs runnable services and their operational context, offering a read-only MCP endpoint to list projects, service status, runbooks, and reconciliation context.
    1
    Apache 2.0
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables deterministic triage of OpenShift alerts by executing YAML-defined runbooks against an upstream OCP MCP server, collecting auditable evidence bundles for LLM interpretation.
    -