aggregating

aggregating is a command for Claude Code from frontal-labs/mcp-server. It costs 0 tokens per session (1,524 once invoked), scanned A, a copy of aggregating, Apache-2.0.

A command for calculating summaries from documents in a search index. It can calculate statistics, group records, make value ranges, and perform nested analysis.

In plain words
What is it for?
Use it for averages, sums, minimums, maximums, category breakdowns, price ranges, date histograms, and multi-level reports.
Why use it?
It avoids fetching every matching document just to calculate totals or groups in application code. It is useful for turning indexed data into summaries and filter options.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it for averages, sums, minimums, maximums, category breakdowns, price ranges, date histograms, and multi-level reports.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/frontal-labs/mcp-server/aggregating
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/frontal-labs/mcp-server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aggregating

README.md
[![agentmods](https://agentmods.dev/badge/commands/frontal-labs/mcp-server/aggregating/github.svg)](https://agentmods.dev/commands/frontal-labs/mcp-server/aggregating)
Your own site
<a href="https://agentmods.dev/commands/frontal-labs/mcp-server/aggregating"><img src="https://agentmods.dev/badge/commands/frontal-labs/mcp-server/aggregating/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aggregating

Your own site · 80×15
<a href="https://agentmods.dev/commands/frontal-labs/mcp-server/aggregating"><img src="https://agentmods.dev/badge/commands/frontal-labs/mcp-server/aggregating.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01524
Opus 5.5 $0.00000 $0.00610
Sonnet 5.5 $0.00000 $0.00305
Haiku 4.5 $0.00000 $0.00152

Measured yesterday against content hash 372b2c0acdea, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

aggregating scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to aggregating — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/upstash-redis-js/search/commands/aggregating.md · 235 lines

How it starts

The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Aggregations

Overview

Run analytics over indexed data using metric and bucket aggregations. Compute statistics, group documents, build histograms, and perform faceted navigation. Aggregations can be nested for multi-level analysis.

Good For

  • Computing averages, sums, min/max across documents
  • Grouping documents by field values (category breakdown)
  • Building price range facets for e-commerce
  • Histogram distributions (price ranges, date ranges)
  • Multi-level analytics (average price per category)

Examples

Metric Aggregations

import { Redis, s } from "@upstash/redis";

const redis = Redis.fromEnv();

const index = await redis.search.createIndex({
  name: "orders",
  prefix: "order:",
  dataType: "json",
  schema: s.object({
    product: s.string(),
    category: s.facet(),
    price: s.number("F64"),
    quantity: s.number("U64"),
    date: s.date(),
  }),
});

// Insert sample data
await redis.json.set("order:1", "$", {
  product: "Laptop",
  category: "electronics",
  price: 999.99,
  quantity: 1,
  date: "2024-06-15",
});
await redis.json.set("order:2", "$", {
  product: "Mouse",
  category: "electronics",
  price: 29.99,
  quantity: 3,
  date: "2024-06-16",
});
await redis.json.set("order:3", "$", {
  product: "Desk",
  category: "furniture",
  price: 249.99,
  quantity: 1,
  date: "2024-07-01",
});
await index.waitIndexing();

// Average price
const result = await index.aggregate({
  aggregations: {
    avg_price: { $avg: { field: "price" } },
  },
});
// result.avg_price -> number

// Multiple metrics at once
const stats = await index.aggregate({
  aggregations: {
    avg_price: { $avg: { field: "price" } },
    total_revenue: { $sum: { field: "price" } },
    cheapest: { $min: { field: "price" } },
    most_expensive: { $max: { field: "price" } },
    order_count: { $count: { field: "price" } },
  },
});

// Combined statistics
const priceStats = await index.aggregate({
  aggregations: {
    price_stats: { $stats: { field: "price" } },
    // Returns: { count, min, max, sum, avg }
  },
});

// Extended statistics (includes variance and standard deviation)
const extended = await index.aggregate({
  aggregations: {
    price_extended: { $extendedStats: { field: "price" } },
    // Returns: { count, min, max, sum, avg, sumOfSquares, variance, stdDeviation }
  },
});

// Percentiles
const percentiles = await index.aggregate({
  aggregations: {
    price_percentiles: { $percentiles: { field: "price", percents: [25, 50, 75, 95] } },
  },
});

// Count distinct values
const uniqueCategories = await index.aggregate({
  aggregations: {
    unique_cats: { $cardinality: { field: "category" } },
  },
});

Read the full file on GitHub · 235 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 235 lines · 0 tokens per session scan A 372b2c0acdea

Subscribe to this mod's changes

aggregating is a command published in the GitHub repository frontal-labs/mcp-server (1 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,524 tokens. A static security scan graded it A with 0 findings. It is 100% identical to aggregating, differing in 0 lines, and is treated as a copy.