Skip to main content
Glama
omnioperand-mcp

omnioperand-mcp

omni_permutations_combinations

Calculate factorials, permutations (nPr), and combinations (nCr) with exact integer precision to avoid arithmetic errors and formula mistakes in statistical work.

Instructions

Permutations & Combinations (nPr & nCr) Calculator. Calculate factorials, permutations (ordered nPr), and combinations (unordered binomial coefficients nCr) with exact integer precision. Discipline: STATISTICS. Governing mathematical model / formula: nPr = n! / (n - r)! | nCr = n! / [r! · (n - r)!].

USAGE GUIDELINES:

  • WHEN TO USE: Invoke for deterministic calculation of combinations_ncr (Combinations nCr (Order Does Not Matter)), permutations_npr (Permutations nPr (Order Matters)), factorial_n (Factorial n!), multiplicity_factor (Permutation Expansion (r!)) using total_n (Total Elements (n)), sample_r (Subset Chosen (r)). Guarantees exact machine floating-point precision, eliminating LLM arithmetic mistakes and formula hallucinations.

  • WHEN NOT TO USE: Do not use for qualitative evaluations or unquantified reasoning. All input parameters must be valid numerical values.

  • SIBLING ROUTING: Use this dedicated specialist tool for 'Permutations & Combinations (nPr & nCr) Calculator' rather than generic dispatchers like omni_universal_query. For cross-discipline dynamic dispatch, see omni_universal_query.

BEHAVIOR & SAFETY:

  • Pure deterministic computation with machine floating-point precision.

  • Read-only, idempotent, and stateless. Zero side effects or persistent state mutations.

  • Input validation: All arguments are validated against physical and domain bounds. Out-of-bounds inputs return a safe diagnostic error status without throwing runtime exceptions.

RETURNS:

  • Structured JSON object containing:

    • status (string): "success" on valid execution or "error" if validation fails

    • calculator (string): "permutations-combinations"

    • category (string): "statistics"

    • name (string): "Permutations & Combinations (nPr & nCr) Calculator"

    • formula (string): Governing mathematical formula string

    • inputs (object): Echoed input parameter dictionary with applied defaults

    • metrics (object): Dictionary of computed outputs:

      • metrics.combinations_ncr (Combinations nCr (Order Does Not Matter)): Formatted display string (e.g. '120')

      • metrics.permutations_npr (Permutations nPr (Order Matters)): Formatted display string (e.g. '720')

      • metrics.factorial_n (Factorial n!): Formatted display string (e.g. '3,628,800')

      • metrics.multiplicity_factor (Permutation Expansion (r!)): Formatted display string (e.g. '6 (r! arrangements)')

    • execution_time_ms (number): Latency in milliseconds.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "omni_permutations_combinations"
  }
}

Input Schema

NameRequiredDescriptionDefault
total_nNoTotal Elements (n). Total pool size (n ≥ r). Default: 10. Min: 1. Max: 65.
sample_rNoSubset Chosen (r). Number of elements chosen. Default: 3. Min: 0. Max: 65.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: read-only, idempotent, stateless, zero side effects, deterministic machine-precision arithmetic. It also discloses validation behavior — out-of-bounds inputs return a diagnostic error status rather than throwing — which is exactly the failure-mode context an agent needs.

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 sectioned layout (usage, behavior, returns) is front-loaded and scannable, and the core purpose appears in the first two lines. However, the RETURNS block is bloated with boilerplate metadata echoes (calculator name, category, name fields) that add little for an agent that only needs status and metrics.

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?

There is no output schema, so the explicit breakdown of the returned status/metrics/execution_time_ms fields is genuinely necessary and is provided in detail. Combined with validation behavior, deterministic-precision guarantees, and routing guidance, nothing material is missing for a two-parameter calculation tool.

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% and both parameters already document their meaning, defaults (10 and 3), and min/max bounds. The description restates total_n as 'Total Elements (n)' and sample_r as 'Subset Chosen (r)' and mentions n ≥ r, but adds no format or constraint detail beyond what the schema already provides, so baseline 3 applies.

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 names a specific computational resource (nPr/nCr/factorial calculator) and states both the verb ('Calculate factorials, permutations... and combinations') and the exact formulas used. It also explicitly distinguishes itself from the generic dispatcher omni_universal_query, so an agent can route to it without ambiguity.

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?

It has an explicit WHEN TO USE listing the exact metrics produced (combinations_ncr, permutations_npr, factorial_n, multiplicity_factor) and the parameters that drive them, plus a WHEN NOT TO USE clause excluding non-numeric/qualitative queries. The sibling routing note tells the agent to prefer this specialist over omni_universal_query.

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