Skip to main content
Glama

wavelet_tree

Builds a wavelet tree from an integer array and answers range kth-smallest queries, enabling order-statistic lookups over subarrays.

Instructions

Build a wavelet tree for an integer array and answer range kth-smallest queries.

Input Schema

NameRequiredDescriptionDefault
arrayYesArray of integers (max 100,000)
queriesNoQueries: {type:'kth', l, r, k} for kth smallest in [l, r)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.3/5.0
Behavior2/5

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

There are no annotations, so the description must carry the full behavioral burden. It doesn't mention whether the tree is built once and then queried, whether multiple queries are supported, what happens if queries are empty, or any performance characteristics. It only states the basic action.

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 description is a single concise sentence that front-loads the main action. It is efficient but could be slightly more informative without sacrificing brevity.

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

Completeness2/5

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

With no annotations and no output schema, the description is too sparse for a tool that likely returns a constructed tree or query results. It lacks details on output format, query behavior (e.g., multiple queries, indexing conventions), and error handling.

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 description coverage is 100%, so the schema already documents both parameters. The description adds little beyond repeating 'integer array' and 'range kth-smallest queries'. However, it does not provide additional meaning beyond the 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?

The description clearly states the verb and resource: 'Build a wavelet tree for an integer array' and also specifies its primary use case ('answer range kth-smallest queries'). This distinguishes it from other data structure tools like segment_tree, fenwick_tree, or suffix_array_build.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

It implies usage for range kth-smallest queries but does not explicitly state when to use this tool over alternatives (e.g., segment_tree or sparse_table) or any preconditions. The schema provides some guidance on the query format, but the description lacks explicit when-to-use context.

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

Deploy Server

Other Tools