GraphMyAnything

Example prompts & tool calls

Each example lists a user prompt, tool name, arguments matching the 0.2.1 schemas, and a sample response shape. All successful responses include tokens_estimate.

Tools: track, forget, query, insight, chart.

  • Example 1

    Daily metric — body weight

    Prompt: Log my weight today: 182.4 pounds. Use metric health.weight.lb.

    Tool: track

    Arguments

    {
      "metric": "health.weight.lb",
      "value": 182.4,
      "tags": { "source": "scale" }
    }

    Sample response

    {
      "ok": true,
      "metric": "health.weight.lb",
      "written": 1,
      "replaced": 0,
      "tokens_estimate": 20
    }
  • Example 2

    Backfill once — Plano, TX population

    Prompt: Backfill Plano population from census into geo.plano_tx.population for 2000, 2010, and 2020.

    Tool: track

    Arguments

    {
      "metric": "geo.plano_tx.population",
      "points": [
        { "ts": 946684800, "value": 188614 },
        { "ts": 1262304000, "value": 259841 },
        { "ts": 1577836800, "value": 285494 }
      ],
      "tags": { "source": "census" }
    }

    Sample response

    {
      "ok": true,
      "metric": "geo.plano_tx.population",
      "written": 3,
      "replaced": 0,
      "tokens_estimate": 24
    }

    ts values are Unix seconds (UTC). Per-point tags merge with top-level tags.

  • Example 3

    Recall stored history — query without re-research

    Prompt: What's the population trend for Plano — use the metric we already stored, summary only.

    Tool: query

    Arguments

    {
      "metric": "geo.plano_tx.population",
      "range": "all",
      "token_budget": 200,
      "points": 0
    }

    Sample response

    {
      "m": "geo.plano_tx.population",
      "rg": "all",
      "s": {
        "l": 285494,
        "mn": 188614,
        "mx": 285494,
        "mu": 244649.67,
        "tr": "up",
        "pct": 51.33,
        "n": 3
      },
      "tokens_estimate": 45
    }
  • Example 4

    Stripe MRR — n8n daily template

    Prompt: After today's Stripe run, record MRR 84210 USD, then prep a lean 90-day read before charting.

    Tool: track + query

    Arguments

    // track
    {
      "metric": "stripe.mrr.usd",
      "value": 84210,
      "tags": { "plan": "mixed", "source": "n8n" }
    }
    
    // query (before chart)
    {
      "metric": "stripe.mrr.usd",
      "range": "90d",
      "token_budget": 300,
      "also_chart": true,
      "points": "auto"
    }

    Sample response

    {
      "m": "stripe.mrr.usd",
      "rg": "90d",
      "s": { "l": 84210, "mn": 80100, "mx": 84210, "mu": 82105, "tr": "up", "pct": 4.2, "n": 90 },
      "tokens_estimate": 52
    }

    With also_chart: true, points: auto omits pts so the following chart call carries the visual.

  • Example 5

    Insight on a trend

    Prompt: In plain English, how has my weight moved over the last 90 days? Flag weird spikes.

    Tool: insight

    Arguments

    {
      "metric": "health.weight.lb",
      "range": "90d"
    }

    Sample response

    {
      "summary": "Metric \"health.weight.lb\" (42 points, 90d). Upward trend over 90d: latest 182.4, 2.1% vs start. No strong anomalies detected (MAD z-score threshold 3.5). Naive linear forecast (next 3 steps): 182.1, 181.9, 181.7.",
      "trend": "Upward trend over 90d: latest 182.4, 2.1% vs start.",
      "anomalies": [],
      "forecast": {
        "horizon": 3,
        "next_values": [182.1, 181.9, 181.7],
        "method": "naive_linear_regression_on_index"
      },
      "stats": { "latest": 182.4, "count": 42, "trend": "up", "pct_change": 2.1 },
      "tokens_estimate": 120
    }

    Use insight when the user wants narrative + anomalies + forecast, not raw numbers.

  • Example 6

    Chart type, theme, and labels

    Prompt: Chart Plano population over 30 years as a dark area chart and label the peaks.

    Tool: chart

    Arguments

    {
      "metric": "geo.plano_tx.population",
      "range": "30y",
      "type": "area",
      "theme": "dark",
      "labels": "extremes"
    }

    Sample response

    {
      "path": "/home/you/.graphmyanything/charts/geo.plano_tx.population-2026-11-23T12-00-00.svg",
      "url": null,
      "tokens_estimate": 48
    }

    Local-only MCP (no sync): path opens the SVG. labels: none | last (default) | extremes | all — see chart-guide.

  • Example 7

    Hosted share URL (synced account)

    Prompt: Chart my last 90 days of stripe.mrr.usd on hosted and give me the live link for Slack.

    Tool: chart

    Arguments

    {
      "metric": "stripe.mrr.usd",
      "range": "90d",
      "type": "line",
      "theme": "dark",
      "labels": "last"
    }

    Sample response

    {
      "path": null,
      "url": "https://graphmyanything.com/c/a1b2c3d4e5f67890",
      "embed_svg": "https://graphmyanything.com/c/a1b2c3d4e5f67890.svg",
      "embed_png": "https://graphmyanything.com/c/a1b2c3d4e5f67890.png",
      "hosted_url_note": "Live chart: https://graphmyanything.com/c/a1b2c3d4e5f67890",
      "tokens_estimate": 52
    }

    After graphmyanything-mcp sync, chart writes to hosted storage and returns stable /c/<id> links. Share pages support hover and tap tooltips on data points.

  • Example 8

    Chart without sharing (share:false)

    Prompt: Render the chart but do not create a public share link.

    Tool: chart (API query param)

    Arguments

    GET /api/v1/chart?metric=stripe.mrr.usd&range=90d&type=line&share=false

    Sample response

    {
      "path": null,
      "url": null,
      "hosted_url_note": "Not shared (share:false).",
      "tokens_estimate": 48
    }

    Use share=false on the hosted chart API when you only need rendering stats, not a new /c/<id> URL.

  • Example 9

    Query a time range with a small series

    Prompt: Show my weight for the last week — include about a dozen points for context.

    Tool: query

    Arguments

    {
      "metric": "health.weight.lb",
      "range": "7d",
      "token_budget": 250,
      "points": 12
    }

    Sample response

    {
      "m": "health.weight.lb",
      "rg": "7d",
      "s": { "l": 182.4, "mn": 181.2, "mx": 183.1, "mu": 182.0, "tr": "flat", "pct": 0.3, "n": 7 },
      "pts": [
        { "ts": 1731888000, "value": 182.0 },
        { "ts": 1732147200, "value": 182.4 }
      ],
      "tokens_estimate": 95
    }

    Range grammar: 7d, 90d, 12w, 1y, 30y, or all.

  • Example 10

    Correct a point (upsert same date)

    Prompt: Yesterday's weigh-in was wrong — it should be 181.9 lb at that day's timestamp.

    Tool: track

    Arguments

    {
      "metric": "health.weight.lb",
      "points": [{ "ts": 1732147200, "value": 181.9 }],
      "tags": { "note": "corrected misread" }
    }

    Sample response

    {
      "ok": true,
      "metric": "health.weight.lb",
      "written": 0,
      "replaced": 1,
      "tokens_estimate": 22
    }

    track upserts on (metric, ts). The same timestamp replaces the previous value; response reports written vs replaced.

  • Example 11

    Delete a point — forget

    Prompt: Remove the erroneous weigh-in from last Tuesday only — keep the rest of health.weight.lb.

    Tool: forget

    Arguments

    {
      "metric": "health.weight.lb",
      "ts": 1731888000
    }

    Sample response

    {
      "ok": true,
      "metric": "health.weight.lb",
      "deleted": 1,
      "tokens_estimate": 18
    }

    Permanent delete on hosted and local SQLite. Other modes: from + to (Unix seconds, inclusive); all: true with confirm: true to drop an entire metric. metric is always required.

  • Example 12

    Multiple metrics — naming convention

    Prompt: I'm tracking weight in pounds and MRR in dollars — keep namespaces separate.

    Tool: chart

    Arguments

    {
      "metric": "stripe.mrr.usd",
      "range": "90d",
      "type": "line",
      "theme": "light",
      "labels": "last"
    }
    MetricMeaning
    health.weight.lbBody weight, pounds
    stripe.mrr.usdMonthly recurring revenue, USD
    geo.plano_tx.populationCity population, count

    Pattern: namespace.subject.unit (unit optional). Use tags for source, plan, or cohort — not for the numeric unit.

Related docs

Source on GitHub: casahome2000/graphmyanything / examples.md