Skip to main content
Glama

probability.factorial

Read-onlyIdempotent

Calculate the factorial of a non-negative integer and return the exact integer string, avoiding float precision loss for large values.

Instructions

n!을 정확한 정수 문자열로 반환한다. n 은 0 이상 정수이며 상한은 20000(환경변수 SOOTOOL_LIMIT_COMBINATORICS_N 으로 조정), 1000 미만은 math.factorial, 이상은 mpmath 로 계산하며 반올림은 없다. 결과 자릿수가 매우 커서 float 로 변환하면 정밀도를 잃는다.

Input Schema

NameRequiredDescriptionDefault
nYes

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

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, and the description adds genuinely non-obvious behavior: the 20000 cap, the SOOTOOL_LIMIT_COMBINATORICS_N override, the math.factorial vs mpmath algorithm switch at n=1000, and the warning that float conversion loses precision. That is substantive context beyond the structured fields.

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?

Four tight sentences, front-loaded with the return type, then validity domain, then implementation details, then the precision caveat. Every sentence carries information; the implementation-detail sentence is slightly more than an agent strictly needs.

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?

An output schema exists, yet the description still notes the result is an exact integer string, and it covers bounds, limits, and precision hazards. For a single-parameter math tool with annotations and an output schema, nothing an agent needs 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 carries the burden and mostly does: n is constrained to a non-negative integer with a 20000 upper bound and an environment-tunable limit. It stops short of stating what happens to negative or over-limit inputs (error vs clamp), which is the remaining gap.

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?

States a specific verb and resource ('returns n! as an exact integer string') and is immediately identifiable as the exact-factorial tool. It does not explicitly contrast itself with the combinatorial siblings probability.nCr / probability.nPr, which is the only real differentiation gap.

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?

Usage is implied rather than stated: the domain (0 <= n <= 20000) is spelled out, so an agent knows when the call is valid, but there is no guidance about when to prefer this over nCr/nPr or a float-based computation, and no exclusion language.

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