Skip to main content
Glama

random_sample

Select a specified number of unique items from an array at random, ensuring no repeats. Ideal for unbiased sampling or random draws.

Instructions

Randomly select multiple unique items from an array (without replacement)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
arrayYesArray to sample from
countYesNumber of items to select
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the key behaviors: random selection, multiple items, uniqueness, and without replacement. However, it does not mention edge cases like count greater than array length or error handling, which would be valuable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, clear sentence that fully conveys the purpose. No filler or redundant information.

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

Completeness4/5

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

For a simple tool with two well-described parameters and no output schema, the description is largely sufficient. It implies a returned array of sampled items. It could be more complete by stating the return type or behavior when count exceeds array length, but this is a minor gap.

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 covers both parameters with descriptions ('Array to sample from', 'Number of items to select'), so the baseline is 3. The description adds the 'unique' and 'without replacement' context but does not elaborate on parameter constraints (e.g., count must be non-negative) beyond schema.

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?

Clearly states the function: randomly select multiple unique items from an array without replacement. This distinguishes it from sibling tools like random_choice (single selection) and random_shuffle (reordering).

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?

The description implies the use case (needing multiple unique random items) and explicitly mentions 'without replacement', which differentiates it from similar tools. However, it does not explicitly name alternatives or state when not to use it, leaving some inference required.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MikeyBeez/mcp-random'

If you have feedback or need assistance with the MCP directory API, please join our Discord server