Skip to main content
Glama

probability.expected_value

Read-onlyIdempotent

Computes the expected value of a discrete random variable from decimal value-probability pairs, using high-precision arithmetic and validating that probabilities sum to 1.

Instructions

이산 확률변수의 기댓값 E[X] = Σ value_i * prob_i 를 구한다. values 와 probabilities 는 같은 길이의 십진 문자열 리스트이며 각 확률은 [0, 1], 합은 1 에서 1e-9 이내여야 한다. Decimal 50자리로 계산하며 연속분포에는 쓸 수 없다.

Input Schema

NameRequiredDescriptionDefault
valuesYes
probabilitiesYes

Output Schema

NameRequiredDescriptionDefault
_metaNo서버가 붙이는 영수증(integrity), 엔진, 힌트
traceYes계산 근거(tool, formula, inputs, steps, output)
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent/closed-world, so the safety profile is known. The description adds substantive behavior beyond that: 50-digit Decimal arithmetic, the 1e-9 sum tolerance, and input validation constraints on probabilities.

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?

Four short sentences, front-loaded with the definition and formula, then constraints and precision, then the exclusion. No sentence is redundant.

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

Completeness5/5

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

For a two-parameter calculator with an output schema, the description covers the formula, input format, validation rules, numeric precision, and applicability limits. Nothing an agent needs in order to call it correctly is missing.

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%, so the description must carry the load, and it does: both parameters are described as equal-length lists of decimal strings, with each probability constrained to [0,1] and summing to 1 within 1e-9. It does not spell out error behavior on length mismatch, which keeps it from a 5.

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?

States a specific verb and resource ('이산 확률변수의 기댓값 E[X]'), gives the exact formula Σ value_i * prob_i, and explicitly excludes continuous distributions. This clearly separates it from siblings like probability.normal_cdf or probability.gamma_pdf.

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 exclusion '연속분포에는 쓸 수 없다' tells the agent when NOT to use it, which is real guidance. However it does not name the alternative to reach for (e.g., a continuous-distribution tool), leaving the redirect implicit.

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