Skip to main content
Glama
ayeyouok

a207-followup-mcp

by ayeyouok

a207-followup-mcp(M4 · 随访系统)

儿童 CKD 随访系统 MCP。对应 PCP 契约 follow_up 输出位。Batch C 交付包(与 M9 报告配对)。

工具清单

工具

类型

权限

说明

schedule_followup

医生/营养师/编排层(MX 收口)

创建随访计划。频率按 KDIGO 2024 儿科推荐自动算(next_due_date)。plan_summary 全角色可见,note_to_clinician 仅临床可见

get_followup_records

全 caller

随访记录与计划时间线。随访计划摘要可见;原始医生备注(doctor_notes / note_to_clinician)仅医生/营养可见,家属/患儿被剔除

get_adherence_score

读/写

全 caller

依从性评分(M4 拥有依从性数据)。三域比率(0-1)→加权复合分(0-100),落库快照

get_pew_timeline

全 caller

PEW 时间线 facade(ADR-007):接受 M3 get_pew_history 输出并入统一时间线,存储归属 M3,零跨包 import。原名 get_pew_history,因与 M3 同名易混淆双跳已更名(P1-2),不保留旧名别名

Related MCP server: ckd-meal-plan-mcp

调用方身份(P0-1)

调用方身份不再是工具入参,由部署侧通过环境变量 A207_CALLER 注入(取值见 a207_policy.CALLERS), 模型无法自证身份;未注入时所有工具 fail-closed 抛 CallerUnknown。 放行集合统一取自 a207_policyFOLLOWUP_WRITE_ALLOWED / FOLLOWUP_CLINICIAN),本包不再维护副本。

A207_CALLER=doctor_assistant python -m a207_followup_mcp.server

关键设计决策(详见 docs/decisions/ADR-008、ADR-009)

1. 随访频率(KDIGO 2024 儿科推荐)

recommend_followup_interval(ckd_stage, albuminuria_stage) 返回推荐间隔(天):

CKD 分期

基础间隔

依据

G1 / G2

180 天(1-2 次/年)

儿科共识 Rec17

G3a / G3b / G4

90 天(≥3-4 次/年)

儿科共识 Rec17 + NICE NG203

G5

60 天(>4 次/年)

儿科共识 Rec17

G5D

30 天(每月)

PRNT 2025 人体测量频率

白蛋白尿升级:A2 缩短 30 天、A3 缩短 60 天(下限 14 天)。

文献依据

  • KDIGO 2024 CKD Guideline, Kidney Int 2024;105(4S):S117-S314(Francis et al. JAMA Pediatr 2024 儿科要点:儿童 CKD 至少每年评估 GFR+蛋白尿,高风险更频)

  • NICE NG203 Table 2(2021,2024 复核)

  • 儿科共识 Rec17(Scielo 初级保健儿科 2024,引 Furth 2018 / KDIGO 2012):G1-2→1-2 次/年,G3-4→≥3-4 次/年,G5→>4 次/年

  • PRNT 2025:CKD2-5 人体测量每 1-3 月,CKD5D 每月(Pediatr Nephrol 40:69-84)

2. 依从性评分公式(透明加权复合分)

composite = 100 × (w_diet·diet_ratio + w_med·med_ratio + w_visit·visit_ratio)
等级:≥80 好 / 50-79 中 / <50 差
  • diet_ratio:饮食日记完成率(来自 M3 日记 / M11 打卡)

  • med_ratio:用药按时率

  • visit_ratio:随访到场率

  • 默认等权(1/3 各),可经 weights 调整

文献依据:MMAS-8(8 项 Morisky)是 CKD 依从性测量最常用、经验证工具(Springer Med 系统综述 2024;0=高、1-2=中、3-8=低);儿科可用 CAAMQ。但儿科 CKD 尚无单一经验证的"营养+用药+就诊"复合评分(pubmed 24814533 综述:单一工具不充分,应多方法组合)。故本复合分为系统定义、待临床验证,等级阈值参照 MMAS-8 风格低/中/高带,非来自单一验证量表。

3. 随访记录数据结构(M4 自行设计)

// FollowUpRecord(追加式,add_followup_record)
{
  "record_id": "FR-Pxxxx-xxxxxxxx",
  "visit_date": "YYYY-MM-DD",
  "visit_type": "outpatient|phone|online|dialysis|nutrition_counsel",
  "ckd_stage": "G1..G5D",                 // 当次快照
  "indicators_snapshot": { ... },        // 体重/身高/Scr/eGFR/K/P/Hb 等(可见)
  "plan_summary": "随访计划摘要",          // 全角色可见
  "doctor_notes": "原始医生备注",          // 仅临床角色可见(家属/患儿剔除)
  "created_by": "doctor_assistant",
  "created_at": "ISO"
}
// FollowUpPlan(schedule_followup 产出)
{
  "plan_id": "FP-Pxxxx-xxxxxxxx",
  "cadence": { "interval_days": 90, "anchor_date": "...", "next_due_date": "...",
               "basis": "...", "citation": "..." },
  "visit_type": "...", "status": "active",
  "plan_summary": "...",                  // 全角色可见
  "note_to_clinician": "...",             // 仅临床角色可见
  "created_by": "...", "created_at": "..."
}

存储:data/followup_store.json,按 patient_idrecords / plans / adherence 三段。

4. PEW 历史归属(ADR-007)

PEW 历史由 M3 拥有并落库a207-nutrition-assessment-mcp-nfyyrecord_pew_risk / get_pew_history)。M4 的 get_pew_history 仅作 facade——接受 M3 输出再并入统一随访时间线,零跨包 import。详见 docs/decisions/ADR-007.md

验证

python -m py_compile src/a207_followup_mcp/*.py
python tests/test_tools.py   # 全部断言应全过

已知缺口(非阻断)

  • 随访计划暂无"逾期/提醒"外发能力,需 M10 通知 MCP 消费 next_due_date 触发提醒(见路线图 Batch D)。

  • 依从性三域比率由调用方提供(M3 日记 / M11 打卡 / 就诊记录),M4 不反向查询这些包(零跨包 import)。

Available Tools

4 tools
get_adherence_scoreA

计算并记录依从性评分(M4 拥有依从性数据)。diet/med/visit 三域比率(0-1) → 加权复合分(0-100)。

等级:≥80 好 / 50-79 中 / <50 差。默认等权(饮食/用药/就诊各 1/3,待临床验证)。

ParametersJSON Schema
NameRequiredDescriptionDefault
callerNoorchestrator
med_ratioYes
diet_ratioYes
patient_idYes
visit_ratioYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the burden. It discloses the side effect of recording, which conflicts with the name 'get', and provides the calculation method. However, it lacks details on idempotency, permissions, or what happens on repeated calls.

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 a compact three-sentence summary covering purpose, formula, and thresholds without waste. Every sentence contributes to understanding the tool.

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?

The core calculation logic is fully specified, but usage guidance, complete parameter descriptions, and side-effect clarity are missing. An output schema exists, so return values are not required, but selection and invocation context is incomplete.

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 0%, so the description must compensate. It explains the three ratio parameters and their range, but does not describe the 'caller' parameter or explicitly map patient_id to schema fields, leaving gaps.

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 calculates and records an adherence score, with explicit formula and grading thresholds. It is distinctly different from sibling tools (followup scheduling, records, PEW history).

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?

Usage is implied for adherence scoring, but no explicit when-to-use or alternatives are mentioned. The description notes M4 owns the adherence data, which gives context but does not exclude other tools.

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

get_followup_recordsA

读取随访记录与计划时间线(读,所有角色可读)。

临床角色(医生/营养/编排/风险)看完整记录(含原始医生备注);患者/家属角色仅见摘要——医生备注被剔除。

ParametersJSON Schema
NameRequiredDescriptionDefault
callerYes
patient_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

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. It discloses a key behavioral trait: role-dependent filtering (doctor notes stripped for patient/family). It also explicitly labels the operation as 'read' and notes all roles can read, implying non-destructive behavior. Lacks details like pagination or error handling, but the critical access-control behavior is well-covered.

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 only two sentences, front-loaded with the core action and read-only nature, then adding the role-based detail. Every sentence earns its place with 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?

Given the output schema exists and parameters are simple, the description covers the essential context: what is read, who can read what, and the fact it's a read operation. It doesn't explain the 'plan timeline' fully, but that's a minor omission for a read tool with an output schema.

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 0%, so the description must add meaning. It does explain the 'caller' parameter implicitly via role lists (clinical vs patient/family) and its effect on visibility. However, 'patient_id' is not explicitly described, and the mapping between parameter names and description is indirect, leaving some ambiguity.

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 follow-up records and plan timeline, with an explicit 'read' label and role-based access. It distinguishes itself from siblings like schedule_followup (write) and get_adherence_score/get_pew_history by focusing on reading follow-up records as a distinct resource.

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 provides clear context on when to use this tool (to read follow-up records) and explains visibility rules based on caller role. It doesn't explicitly mention alternatives/exclusions, but the role scoping makes the intended use clear enough.

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

get_pew_historyB

PEW 历史聚合 facade(ADR-007:存储归属 M3)。

接受 M3 get_pew_history 的输出(list of {date, score, level}),并入统一随访时间线。零跨包 import。

ParametersJSON Schema
NameRequiredDescriptionDefault
patient_idYes
pew_historyNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It adds useful behavioral context: the expected input shape ({date, score, level}), the architectural role (facade per ADR-007, storage owned by M3), and a design constraint (zero cross-package imports). However, it does not disclose whether the operation is read-only, whether merging into the timeline has side effects, or failure behavior — '并入' (merge) is ambiguous about mutation.

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

Conciseness4/5

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

The description is compact — three short sentences with the core purpose front-loaded ('PEW 历史聚合 facade'). It avoids filler. The ADR-007 reference and '零跨包 import' are niche implementation details that add limited value for an agent, but they are brief and do not significantly bloat the text.

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?

An output schema exists, so return values are covered elsewhere, and the description adequately conveys the data contract and architectural role. However, with no annotations and 0% schema coverage on parameters, the missing usage guidance and the ambiguous side-effect profile of the merge operation leave the description incomplete for safe agent invocation.

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?

With 0% schema description coverage, the description must compensate, and it partially does: it documents pew_history as the M3 get_pew_history output with entries of {date, score, level}, adding meaning beyond the schema's generic 'array of objects with additionalProperties'. However, patient_id is left unexplained, and it is unclear when pew_history should be supplied versus left as the default null.

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 states a specific function: aggregate PEW history data from M3 (list of {date, score, level}) into a unified follow-up timeline, which gives a clear verb+resource. It is contextually distinct from siblings like schedule_followup and get_adherence_score. However, the architectural jargon 'facade,' the ADR-007 reference, and the mismatch between the name 'get_pew_history' (suggesting retrieval) and the described merge/aggregation behavior introduce some ambiguity.

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?

No explicit when-to-use guidance, no alternatives named, and no exclusions are provided. The only implicit hint is '接受 M3 get_pew_history 的输出' (accepts M3 get_pew_history output), which suggests it is for integrating M3-sourced data, but the description never says when to choose this tool over siblings or what prerequisites must be met.

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

schedule_followupA

创建随访计划(写,MX 收口:仅医生/营养师/编排层)。频率按 KDIGO 2024 儿科推荐自动计算。

ckd_stage=G1/G2/G3a/G3b/G4/G5/G5D;anchor_date=本次就诊日 YYYY-MM-DD;plan_summary 摘要所有角色可见; note_to_clinician 仅医生/营养可见。返回含 next_due_date 的计划。

ParametersJSON Schema
NameRequiredDescriptionDefault
callerYes
ckd_stageYes
patient_idYes
visit_typeNooutpatient
anchor_dateYes
plan_summaryYes
albuminuria_stageNoA1
note_to_clinicianNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, but the description discloses key behavioral traits: it's a write operation with restricted roles, automatically computes follow-up frequency per KDIGO 2024, and defines field-level visibility (plan_summary visible to all, note_to_clinician restricted). It also states the return includes next_due_date. It does not mention error handling, idempotency, or auth requirements, but covers critical behavior.

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 two concise sentences, front-loaded with the core purpose and role restriction, followed by a compact parameter legend. Every clause adds value with no 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?

Given a write tool with 8 parameters and no annotations, the description covers purpose, access control, algorithm, key parameters, and return value. The output schema is present, so return details are covered. Missing edge-case behavior and some parameter meanings reduce completeness slightly, but it's strong overall.

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 description coverage is 0%, so the description must compensate. It explains ckd_stage allowed values (G1-G5D), anchor_date format, and visibility semantics for plan_summary and note_to_clinician. However, it leaves caller, visit_type, albuminuria_stage, and patient_id unexplained, so coverage is partial.

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 verb '创建' (create) and resource '随访计划' (follow-up plan), explicitly noting it is a write operation ('写') with role restrictions. It differentiates from sibling read tools (get_followup_records etc.) by its creation focus and mentions automatic KDIGO calculation.

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 provides access context (only doctors/nutritionists/orchestration layer) and indicates the tool is for creating follow-up plans with automatic frequency calculation. It does not explicitly mention when not to use it or compare to siblings, but the write-vs-read distinction is implicit. The 'MX 收口' note clarifies scope.

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 observedget_adherence_score
    • First observedget_followup_records
    • First observedget_pew_history
    • First observedschedule_followup

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation4/5

Each tool targets a distinct function: scheduling, reading records, computing adherence, and retrieving PEW history. There is slight potential confusion between get_followup_records and get_pew_history since both are reads related to the timeline, but the descriptions clarify their specific scopes.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern (schedule_followup, get_followup_records, get_adherence_score, get_pew_history). The 'get_' prefix is uniformly used for read operations, with no mixed conventions or camelCase deviations.

Tool Count5/5

Four tools cover the core follow-up workflow—creating plans, reading records, scoring adherence, and aggregating PEW data. This is well-scoped for the server's purpose and falls within the ideal 3-15 range.

Completeness3/5

The server supports creating and reading follow-up plans/records but lacks update/delete operations for plans, which are common lifecycle needs. It also has no tool to record completed follow-ups, leaving notable gaps in the follow-up management cycle.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Mock MCP server for pediatric CKD risk warning, enabling patient biochemical trend retrieval, deterministic risk rule evaluation, structured alert triggering, and clinical SOP lookup using simulated data.
    5
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    This MCP server generates individualized meal plans for children with chronic kidney disease (CKD) based on KDIGO 2024/PRNT 2020/KRCP 2025 guidelines, incorporating patient age, CKD stage, allergies, dietary culture, and diet diary analysis. It provides deterministic nutrient computations and tools for meal plan generation, food database lookup, and risk analysis.
    13
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    MCP server for pediatric CKD lab data, providing lab panel queries, critical value alerts, trend analysis, and write operations with role-based permissions.
    5
    -
  • F
    license
    A
    quality
    B
    maintenance
    Read-only MCP server providing pediatric CKD patient master data with tools for patient profiles, diagnosis, nutrition ceilings, guardian verification, and patient lists, designed for the CKDNutri project.
    5
    -