Skip to main content
Glama

Double Factorial

double_factorial
Read-onlyIdempotent

The double factorial n!!. Even n uses the even factors down to 2, and odd n uses the odd factors down to 1. 0!! is 1, 6!! is 48, and 7!! is 105. n runs from 0 to 4096. Past 15 digits the value is a decimal string. Price: $0.001 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/double-factorial

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "n": "<n>"
    },
    "name": "double_factorial"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real context annotations cannot: the input domain (0 to 4096), the return-type switch to a decimal string past 15 digits, and the x402 payment cost of $0.001 USDC per successful call plus an HTTPS fallback endpoint. It stops short of describing error or payment-failure behavior, so not 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the definition and examples, then bounds, output format, and commercial terms — a sensible order with little waste. It is dense, packing semantics, limits, pricing, and an alternate endpoint into four sentences, but every sentence carries information the agent 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?

With no output schema, the description compensates by explaining the return representation (decimal string past 15 digits) and giving worked examples of results. Combined with the stated domain and payment requirement, an agent has everything needed to call this correctly.

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%, so the description carries the burden and does: it states n's full range (0 to 4096), which matches the schema bounds, and explains how even versus odd n changes the computation. The only gap is that the parameter is never named explicitly, so mapping the prose to the field `n` requires a small inference.

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 the specific operation (double factorial n!!) and, more importantly, defines it unambiguously: even n multiplies even factors down to 2, odd n multiplies odd factors down to 1. The concrete examples (0!!=1, 6!!=48, 7!!=105) let an agent distinguish this from neighbors like alt_factorial, superfactorial, and subfactorial without opening any schema.

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 only implied by the mathematical definition and the stated domain of n; there is no explicit when-to-use or when-not-to-use statement, and no sibling tool is named as an alternative. For a single-purpose math primitive this is workable, but the agent must infer selection from semantics alone.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources