Skip to main content
Glama
Ian3738
by Ian3738

survival_analysis

Perform survival analysis: compute Kaplan-Meier curves, median survival, and log-rank tests, or fit Cox proportional hazards models with hazard ratios and assumption checks.

Instructions

Survival / time-to-event analysis. type='km' gives Kaplan-Meier estimates with median survival, a survival curve, and a log-rank test when group is supplied; times_of_interest adds survival probabilities at chosen follow-up times. type='cox' fits a Cox proportional hazards model with hazard ratios, concordance, and the Schoenfeld test of the proportional-hazards assumption. event must be coded 1 = event occurred, 0 = censored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesDataset name in the session.
timeYesFollow-up time column.
typeNokm, cox, or auto (cox when covariates are given).auto
eventYesEvent indicator column: 1 = event occurred, 0 = censored.
groupNoGrouping column to compare survival across.
plotsNoInclude the survival curve.
time2NoEnd time, for interval-censored or time-varying data.
digitsNoDecimal places.
save_asNoName for the fitted model in the session.
conf_levelNoConfidence level.
covariatesNoPredictors for a Cox model.
times_of_interestNoReport survival probability at these times, e.g. [365, 730].

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.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 behavioral burden. It discloses concrete outputs for each model type: median survival, survival curve, log-rank test, hazard ratios, concordance, and the Schoenfeld test. It also states the required event coding, which is a critical operational detail.

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 dense and front-loaded, with the core purpose stated first and model-specific details following. It is appropriately sized for a complex statistical tool, though it slightly repeats the event-coding requirement already present in the schema.

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 12 parameters and no output schema or annotations, the description covers the key decision points and expected results well. It could be more explicit about the `auto` type and `time2` usage, but the schema already documents those, and the description provides enough operational context for correct selection and invocation.

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 description coverage is 100%, so the baseline is 3. The description adds meaningful semantics beyond the schema by explaining what `type='km'` and `type='cox'` actually produce, and how `group` and `times_of_interest` change the analysis. This goes beyond simple field names.

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 opens with a specific phrase, 'Survival / time-to-event analysis,' and immediately distinguishes the tool's two primary modes: Kaplan-Meier and Cox proportional hazards. It clearly states the resource and the analytical outputs, making it distinct from regression and other statistical siblings.

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 gives clear internal guidance on when to use `type='km'` vs `type='cox'`, when a log-rank test is included, and when `times_of_interest` is relevant. It does not explicitly discuss alternatives or exclusions among sibling tools, but the time-to-event context is clear enough to guide an agent.

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

Latest Blog Posts

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/Ian3738/r-stats-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server