Skip to main content
Glama

weighted_mean

Computes weighted arithmetic, geometric, and harmonic means from numeric values and optional weights, enabling accurate aggregated averages for uneven data.

Instructions

Compute weighted, arithmetic, geometric, and harmonic means of a set of values.

Input Schema

NameRequiredDescriptionDefault
valuesYesArray of numeric values.
weightsNoOptional weights (same length as values).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden. It mentions computing means but doesn't disclose behavioral traits such as whether it handles empty arrays, negative values, zero weights, or the behavior of the weighted mean when weights are omitted. No information on output format or edge cases.

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 a single, efficient sentence that front-loads the core action and lists the mean types without any waste. It is appropriately sized for the tool's complexity.

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?

For a 2-parameter tool with no annotations and no output schema, the description is incomplete. It fails to explain how weights affect the computation, what happens if weights are omitted, or the return values (e.g., a single number or object with multiple means). An agent would need to guess about the output structure and edge-case behavior.

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 both parameters (values and weights) are fully documented in the schema. The description adds no additional meaning beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Compute' and the resource 'weighted, arithmetic, geometric, and harmonic means of a set of values.' It distinguishes itself from generic mean calculators by listing multiple mean variants. However, it doesn't explicitly differentiate from other statistical tools like descriptive_stats or statistics_calc that might overlap.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to use this tool versus alternatives. The description implies usage for computing various means, but it doesn't state conditions, exclusions, or alternatives like descriptive_stats. No usage context is provided.

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