Skip to main content
Glama

get_category_sample

Sample product detail pages from a category page using spread, random, or top-N strategies for quick PDP spot-checks.

Instructions

Sample a set of PDPs from a category page. Scrapes the category page (or uses cached data), picks product URLs based on a sampling strategy, then calls scrape_pdp on each in parallel. Useful for PDP spot-checks without manual URL selection. Strategies: "spread" (low/mid/high price tiers), "random" (random selection), "top" (first N products).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesCategory page URL to sample PDPs from.
countNoNumber of PDPs to sample. Default: 2, max: 5.
strategyNoSampling strategy. Default: "spread".
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses key behaviors: scraping category page with caching ('or uses cached data'), strategy-based URL selection, and parallel calls to scrape_pdp. It also explains the three strategies in detail. This goes beyond the schema and gives the agent a clear picture of the tool's execution model.

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?

The description is concise and well-structured: it opens with the primary purpose, explains the workflow, states the use case, and lists strategies. Each sentence earns its place, with no unnecessary filler. The density of useful information is high.

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 tool with three parameters, full schema coverage, and no output schema, the description is comprehensive. It covers what the tool does, how it works, when to use it, and parameter semantics. It doesn't describe return values, but given the tool's simplicity and the sibling scrape_pdp's likely role, this is a minor gap. Overall, it's complete enough for reliable selection and 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. The description adds value by explicitly defining the strategy enum values ('spread' as low/mid/high price tiers, 'random', 'top' as first N products). This is not present in the schema descriptions, enhancing the agent's understanding of how to choose a strategy.

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 the tool's purpose: 'Sample a set of PDPs from a category page.' It distinguishes this from sibling tools like scrape_pdp by describing its multi-step workflow (scrape category page, pick URLs, call scrape_pdp in parallel). The verb 'sample' is specific and differentiates from direct scraping.

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 says it's 'Useful for PDP spot-checks without manual URL selection,' which provides clear context for when to use it. It doesn't explicitly name alternatives or exclusions, but the mention of calling scrape_pdp implies it's a higher-level alternative. This meets the 'clear context, no exclusions' level.

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/grahamton/merchGent'

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