Skip to main content
Glama

Barajar o muestrear arreglo

array-shuffle
Read-only

Mezcla un arreglo (Fisher-Yates) o toma una muestra de k elementos sin reemplazo. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: ordenar un arreglo de valores u objetos por una o más claves (array-sort). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). No determinista: aleatorio salvo que se dé seed. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Shuffles an array (Fisher-Yates) or draws a sample of k items without replacement. Uses secure randomness, or a seed for reproducible results. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: sorting an array of values or objects by one or more keys (array-sort). Side effects: none (read-only, no network access, no stored state). Not deterministic: random unless seed is given. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
seedNoOptional seed for reproducible output (string; optional; up to 256 chars).
itemsYesArray (array; required).
sample_sizeNoReturn only k items (integer; optional; min 0; max 100000).

Output Schema

NameRequiredDescriptionDefault
avisoNo
itemsNoany JSON value

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / items / examples
      Added value: +[
      +  [
      +    1,
      +    2,
      +    3,
      +    4,
      +    5
      +  ]
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties / aviso
      Added value: +{
      +  "type": [
      +    "null",
      +    "string"
      +  ]
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false and idempotentHint=false, so safety is covered structurally. The description adds genuinely new behavioral context beyond that: secure randomness, non-determinism unless a seed is supplied, and hard limits (64 KB input, 1 s runtime, 1 MB result) -- useful operational facts an agent cannot read from the annotations.

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 content is front-loaded and cleanly sectioned (Cuándo / No para / Efectos secundarios / Límites), so nothing is buried. However, the full Spanish text is repeated verbatim in English, roughly doubling length without adding information.

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?

Given an output schema exists (no need to describe return values), full parameter coverage, and complete annotations, the description still supplies the missing pieces an agent needs: randomness/determinism behavior and size/time limits. Nothing material is absent for correct 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 coverage is 100%, so the baseline is 3, but the description goes further: it explains that supplying a seed makes output reproducible and that sample_size means 'k elements without replacement' -- semantics the terse schema descriptions ('Return only k items') do not convey. That added meaning justifies exceeding the baseline.

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: shuffles an array via Fisher-Yates or draws a k-item sample without replacement. It explicitly contrasts with array-sort ('No para: ordenar un arreglo...'), so an agent can distinguish it from the nearest sibling 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 Guidelines5/5

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

Provides an explicit 'Cuándo' section describing the triggering context (transforming/comparing/checking structured data like JSON, CSV, YAML, XML, arrays) and an explicit 'No para' exclusion pointing at array-sort. Both the positive and negative selection conditions are stated.

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