Skip to main content
Glama

sampler_sample_weighted

Perform weighted random sampling from items with automatic weight normalization. Returns selected samples and normalized weights for AI applications.

Instructions

[sampler] Weighted random selection. weights auto-normalized. Returns {sample, weights_normalized}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
weightsYes
nNo
seedNo
replacementNo
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