Skip to main content
Glama

probability.nPr

Read-onlyIdempotent

Calculates ordered permutations P(n, r) as exact integer strings for n up to 20,000, with no rounding. Use for ordered selections; use combinations for unordered choices.

Instructions

순열 P(n, r) = n!/(n-r)!을 정확한 정수 문자열로 반환한다. n, r 은 0 이상 정수(r ≤ n, n 상한 20000)이며 반올림은 없다. 순서를 구분하지 않는 선택에 쓰면 r! 배 크게 나오므로 그 경우는 nCr 을 쓴다.

Input Schema

NameRequiredDescriptionDefault
nYes
rYes

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.7/5.0
Behavior4/5

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

Goes beyond the readOnly/idempotent annotations by disclosing that the output is an exact integer string with no rounding — the key behavioral fact that prevents a float-overflow assumption. It omits what happens when the constraints are violated (error shape), which keeps it short of a 5.

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?

Three short sentences, each earning its place: definition, domain/return format, then sibling routing. The core identification is front-loaded and there is no filler.

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 pure two-parameter math function with an output schema, the description supplies everything an agent needs: the formula, the exact-string return format, the numeric domain and bound, and the alternative tool for unordered selection. No essential calling information 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 coverage is 0% — the schema only repeats 'N' and 'R' as titles — so the description carries the full parameter burden and does so: both are non-negative integers, with r ≤ n and n ≤ 20000. It does not say whether out-of-range inputs error or clamp, leaving one gap.

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 ('returns permutation P(n,r)') and gives the exact formula n!/(n-r)!, so there is no ambiguity about the computation. It also contrasts the result with nCr, separating it from its nearest sibling without requiring the schema to be opened.

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

Usage Guidelines5/5

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

Explicitly names the alternative and the condition that selects it: if order does not matter the result is r! times too large, so use nCr instead. Domain preconditions (r ≤ n, n ≤ 20000) are stated, giving an agent the guardrails needed before calling.

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