Skip to main content
Glama
Wellness Project MCP

Wellness Project MCP

deep_analysis

Read-onlyIdempotent

Run read-only SQL over a private copy of your health history to analyze trends, compare periods, and find correlations across workouts, sleep, nutrition, and recovery.

Instructions

Deep Analysis: read-only SQLite SQL over a private copy of the user's full health history. Use for: questions spanning several data types (training with sleep, nutrition with weight); long or all-time horizons; trends, progress, period comparisons; totals, averages, rankings, correlations; anything focused tools would need many calls for; any request for a "deep analysis". For one recent fact (today's workout, last night's sleep) use the focused tool. mode=discover: topics -> matching tables with columns, units, row counts, dates; no topics -> table index. mode=query: one SELECT/WITH. period or date_from/date_to limits the copy (faster); omit for all history. Every result carries calendar; the first also carries user_rules. Take relative dates from calendar or period, never your own math. Results list coverage per table (dates, rows, cuts): a short or empty result is not proof data is missing. Scope dates to the request. Joining sessions to sets repeats session values: aggregate each level alone, then join. Not every session is lifting: filter by activity for strength questions. An association is not a cause. Values stored in lb, mi, kcal, C: convert to user_rules units. wearable_daily, sleep_log, body_metrics, runs hold the app's resolved value per day; *_by_source hold raw per-device rows. Dates are YYYY-MM-DD. Timestamp tables (hydration, caffeine, doses, cardiac events) are UTC: group and filter them by local_date. glucose_readings_daily and hydration_entries_daily are one row per local day and source: use them for long ranges; if a raw copy is refused for size, query the _daily table or narrow the dates. Helpers: median(x), percentile(x,p), stddev(x) (NULL under 3 values), corr(x,y) (NULL under 8 pairs), corr_n(x,y) (pairs used), week_start(date[,dow 0=Sun 1=Mon]), month_start(date). Report n with any statistic.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "<mode>"
    },
    "name": "deep_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNoquery: one SELECT or WITH statement.
modeYesSee mode= lines above.
periodNoquery: a named calendar period, resolved by the server; sets the dates copied.
topicsNodiscover: subjects or table names, e.g. ["sleep","resting heart rate"].
date_toNoquery: last date to copy, YYYY-MM-DD.
purposeNoquery: what this answers, a few words.
date_fromNoquery: first date to copy, YYYY-MM-DD.

Output Schema

NameRequiredDescriptionDefault
resultYesHuman-readable result text returned by the tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, closed-world, non-destructive, but the description adds substantial behavior beyond them: the query runs against a private copy bounded by period/date range (faster), every result carries calendar and the first carries user_rules, results report per-table coverage, and a short/empty result is not proof of missing data. It also discloses semantic hazards (join fan-out on session values, non-lifting sessions, correlation vs causation), unit storage (lb, mi, kcal, C), UTC timestamps requiring local_date grouping, and the _daily fallback when a raw copy is refused for size.

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?

Front-loaded with purpose then usage, with terse labeled sections for modes, results, pitfalls, units, and helpers, so an agent can scan to what it needs. It is dense and long – several warnings (joins, causation, coverage) sit in one block – but nearly every sentence carries operational information rather than filler.

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

Completeness5/5

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

For a high-complexity, 7-parameter, free-form SQL tool this covers the prerequisites an agent needs: mode semantics, date scoping, result envelope, helper functions with their NULL thresholds, unit conventions, timestamp timezone handling, and the large-range fallback. An output schema exists, and the description correctly spends its length on behavior rather than restating return shapes.

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 100%, so the baseline is 3; the description goes further by explaining that mode=discover with topics returns matching tables with columns/units/row counts/dates and without topics returns a table index, and that period/date_from/date_to constrain which data is copied. It does not explain the purpose parameter or the exact topic-matching behavior, leaving some added value on the table.

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?

States a specific verb and resource – read-only SQLite SQL over a private copy of the user's full health history – and immediately distinguishes itself from the focused tools for single recent facts. An agent can tell exactly what class of work this tool is for without opening the schema.

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

Usage Guidelines5/5

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

Enumerates concrete use cases (cross-domain questions, long/all-time horizons, trends, totals, rankings, correlations, 'deep analysis' requests) and explicitly names the alternative behavior for the opposite case ('For one recent fact ... use the focused tool'). It also disambiguates its own modes: discover for topics/table index, query for a single SELECT/WITH, and when to supply period vs date range vs omit entirely.

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