Skip to main content
Glama

sampler_sample_list

Generate a random sample of n items from a list. Optionally use replacement for oversampling. Returns the sample, sample size, and total items.

Instructions

[sampler] Random sample of n items. replacement=true for oversampling. Returns {sample, n, total}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
nYes
seedNo
replacementNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description discloses that it performs random sampling, supports oversampling with replacement, and returns a structured object. It does not cover edge cases like empty lists or error handling, but the core behavior is clear.

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?

Extremely concise: three sentences that front-load the purpose and add critical details (replacement, return format). No verbose or unnecessary text.

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?

Given the tool's simplicity and presence of an output schema (implied from description), the explanation is adequate. It lacks guidance on edge cases and alternative tools among siblings, but covers the essential contract.

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 description coverage is 0%, but the description explains items, n, and replacement (oversampling). It omits the seed parameter, which is optional. The description partially compensates for missing schema descriptions.

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?

The description clearly states it performs a random sample of n items from a list, with explicit mention of oversampling via replacement. The name 'sampler_sample_list' and prefix 'sampler' distinguish it from siblings like sampler_random_choice (single item) or sampler_random_split (partition).

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 provides a clear usage hint for replacement (oversampling) but does not explicitly contrast with other sampling tools. However, the purpose is straightforward, and the sibling tools' names imply their specialized uses.

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/0-co/agent-friend'

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