Skip to main content
Glama

calculate_combinations

Calculate combinations (nCr) and permutations (nPr) for combinatorics and probability problems with given n and r values.

Instructions

Calculate nCr (combinations) and nPr (permutations) for given values.

Use this for combinatorics and probability calculations.

Parameters:
    n — Total number of items (non-negative integer).
    r — Number of items to choose/arrange (non-negative integer, ≤ n).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes
rYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It specifies constraints (non-negative integers, r ≤ n) but does not disclose the output format, error handling, or edge cases. It is adequate but not rich.

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 very concise with three short paragraphs. It uses a clear structure: purpose, usage, and parameter details. No redundant or unnecessary sentences.

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

Completeness4/5

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

For a simple combinatorics tool with an existing output schema, the description covers input parameters and usage context. It lacks mention of output format or edge cases, but overall is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (only titles and types). The description adds full meaning: explains what n and r represent, their constraints, and their relationship. This is essential and compensates entirely.

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 clearly states it calculates both nCr (combinations) and nPr (permutations), with specific verb+resource. It distinguishes itself from siblings like factorial_calculator or prime_operations by naming both operations.

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?

The description says 'Use this for combinatorics and probability calculations,' which gives context but does not explicitly state when not to use or mention alternatives. It lacks exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scotia1973-bot/api-hub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server