Skip to main content
Glama

三域医研 · 科研算法引擎 (SanYu Research Engine)

Propensity score matching (PSM) / 倾向性评分匹配 PSM

propensity_score_matching
Read-only

Propensity score matching (PSM) / 倾向性评分匹配 PSM | USE WHEN: match treated and control subjects on baseline covariates (1:1 nearest neighbour within caliper), then report SMD balance | ALIASES: PSM, 倾向性评分, 倾向评分匹配, propensity score, 1:1匹配, 基线可比, 混杂控制, 匹配后均衡 | RETURNS: 匹配后样本与均衡性

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "data": [
        {
          "age": 62,
          "sex": 0,
          "treat": 1
        },
        {
          "age": 58,
          "sex": 1,
          "treat": 0
        },
        {
          "age": 65,
          "sex": 0,
          "treat": 1
        },
        {
          "age": 61,
          "sex": 1,
          "treat": 0
        },
        {
          "age": 70,
          "sex": 0,
          "treat": 1
        },
        {
          "age": 55,
          "sex": 0,
          "treat": 0
        }
      ],
      "caliper": 0.2,
      "treatment": "treat",
      "covariates": [
        "age",
        "sex"
      ]
    },
    "name": "propensity_score_matching"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNo样本表:每行一个受试者的字典,如 [{"treat":1,"age":62,"sex":0}, …](也可改用 treatment/covariates 直接传数组)
ratioNo匹配比例,默认 1
treatmentYes处理变量(1=处理组,0=对照组)。传 data 时填列名 "treat";也可直接传 0/1 数组
covariatesYes协变量列名数组,如 ["age","sex"](传 data 时)或二维数值矩阵

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / required
      Previous value: -[]New value: +[
      +  "treatment",
      +  "covariates"
      +]
  2. Added

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false and destructiveHint=false, so the safety profile is covered. The description adds genuine behavioral content beyond that: the matching algorithm, the caliper constraint, and the returned artifacts (matched sample plus SMD balance). It omits consequential details such as whether unmatched treated subjects are dropped, the default caliper, and how ties are broken.

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 pipe-delimited USE WHEN / ALIASES / RETURNS layout is front-loaded and easy to scan, with no narrative padding. The alias block is long, largely repeated Chinese variants, and consumes a noticeable share of the text for retrieval benefit rather than task guidance.

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 four-parameter statistical tool with full schema coverage, annotations, and no output schema, the description supplies purpose, selection condition, method, and a high-level return summary. What remains thin — data-shape expectations and the fate of unmatched rows — is partly carried by the schema's parameter descriptions.

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 100%, so the schema already documents all four parameters and a baseline of 3 applies. The description only indirectly touches parameters via 'within caliper' and '1:1', and that fixed '1:1' framing sits slightly at odds with the exposed 'ratio' parameter, which accepts values other than 1.

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 verb+resource ('match treated and control subjects on baseline covariates') and adds method detail ('1:1 nearest neighbour within caliper') plus the balance output ('report SMD balance'). No sibling in the provided list performs propensity matching, so there is no realistic confusion to disambiguate, which keeps it just 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 Guidelines4/5

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

An explicit 'USE WHEN' clause names the condition that selects this tool (matching treated/control subjects on baseline covariates). It gives clear positive guidance but no when-not conditions, no prerequisites, and no pointer to an alternative approach such as regression adjustment.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.