Skip to main content
Glama

Permutations

permutations
Read-only

Calculate the number of ordered arrangements of k items from a set of n without repetition. Useful for combinatorial count of ordered choices.

Instructions

Calculate the number of ways to choose k items from n items without repetition and with order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoThe optional number of items to choose.
nYesThe number of items to choose from.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.1
    • addedInput schema / additionalProperties
      Added value: +false
  2. Addedv1.0.0
  3. Removed
  4. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true, so the safety profile is already known. The description adds behavioral context by specifying 'without repetition and with order,' which clarifies the counting semantics. However, it does not disclose what happens when the optional k is null or how constraints like k ≤ n are handled, leaving some behavioral gaps.

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 a single, front-loaded sentence with no filler. It directly states the operation and its key constraint, making it efficient and easy to parse. Every word contributes to the meaning.

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

Completeness2/5

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

Although an output schema exists and annotations cover read-only behavior, the description is incomplete regarding the optional k parameter. It does not explain what k=null signifies (likely permutations of all n items), nor does it address the constraint that k must be ≤ n. An agent could misinvoke the tool when k is null or when k > n without this knowledge.

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%, so both n and k are already documented in the schema. The description rephrases the semantics ('choose k items from n items') but adds no new detail about parameter meaning, especially the null default for k. Thus, the schema carries the parameter documentation burden, making a baseline score of 3 appropriate.

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 the operation: 'Calculate the number of ways to choose k items from n items without repetition and with order.' This specifies the verb, resource, and the defining constraint (order matters) that distinguishes it from combinations. Sibling tools are unrelated, so no confusion.

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

Usage Guidelines2/5

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

The description provides no explicit guidance on when to use this tool versus alternatives. It does not mention exclusions, prerequisites, or what to use when order does not matter. The only usage signal is implicit in the purpose, which is not sufficient for optimal tool selection.

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