Skip to main content
Glama

Agrupar arreglo por clave

array-group-by
Read-onlyIdempotent

Agrupa objetos por el valor de una clave y devuelve grupos y conteos. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: contar las apariciones de cada valor distinto (array-count-by). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Groups objects by the value of a key (dotted path), returning an object of arrays and group counts; missing keys go under "null". When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: counting occurrences of each distinct value (array-count-by). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
byYesObject key (dotted path allowed) to compare by (string; required; up to 500 chars).
itemsYesArray (array; required).

Output Schema

NameRequiredDescriptionDefault
countsNo
groupsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / by / examples
      Added value: +[
      +  "t"
      +]
    • addedInput schema / properties / items / examples
      Added value: +[
      +  [
      +    {
      +      "t": "a",
      +      "v": 1
      +    },
      +    {
      +      "t": "b",
      +      "v": 2
      +    },
      +    {
      +      "t": "a",
      +      "v": 3
      +    },
      +    {
      +      "v": 4
      +    }
      +  ]
      +]
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Adds real behavioral context beyond the annotations: the null bucket for missing keys, determinism, and concrete operational limits (64 KB input, 1 s per call, 1 MB result) that the annotations do not carry. Some sentences (read-only, no network, no stored state) merely restate readOnlyHint/openWorldHint, but the limits and null-handling are genuine additions and nothing conflicts with the declared hints.

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 and well-structured: purpose, when/not-for, side effects, determinism, and limits in labeled clauses. The bilingual duplication doubles the token cost with identical content, which is defensible for a Spanish-titled tool but is still redundancy rather than efficiency.

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?

An output schema covers return values, the annotations cover safety and idempotency, and the description fills the remaining gaps an agent needs: which sibling to prefer, what happens to missing keys, size/time bounds that could cause failure, and determinism. Nothing material is left unspecified.

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%, and the schema already documents `by` as a dotted-path key and `items` as a required array, so the description is largely restating structured data. It does clarify that a missing path yields a "null" group, which is the only semantics added beyond the schema — baseline 3 is appropriate.

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 (groups objects by the value of a key) plus the exact output shape (object of arrays plus group counts) and the edge case (missing keys fall under "null"). It also explicitly names the sibling array-count-by as the thing it is not, so an agent can distinguish the two without opening either schema.

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?

Provides an explicit "Cuándo/When" clause and a hard exclusion ("No para: contar las apariciones… array-count-by"), which is more than most definitions offer. The positive when-to-use clause is broad enough to apply to many array tools, so it stops short of a full 5, but the routing to the alternative is unambiguous.

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.

Resources