Skip to main content
Glama

ScorpTech x402 Tools

Subfactorial

subfactorial
Read-onlyIdempotent

The subfactorial !n, the number of derangements of n objects. !0 is 1, !1 is 0, !2 is 1, and !5 is 44. n runs from 0 to 4096. Past 15 digits the value is a decimal string. Returns JSON with: n, value. Price: $0.001 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/subfactorial

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": "subfactorial"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

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/non-destructive, but the description adds real behavior beyond them: the 0–4096 bound, the representation change to a decimal string past 15 digits, the return fields (n, value), and a paid x402 cost of $0.001 USDC with the equivalent HTTP endpoint. That payment and output-format disclosure is exactly the kind of context annotations cannot carry.

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, then constraints, output shape, and pricing in a tight sequence with no filler. The pricing and duplicate endpoint sentence is slightly utilitarian but earns its place for an agent that must know the call is paid.

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?

With no output schema, the description correctly supplies the return shape (n, value) and the large-value string encoding, plus the domain limit. What is missing is minimal: error behavior and confirmation that results are exact integers below the threshold.

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 coverage is 0%, so the description must carry the parameter alone. It re-states the 0–4096 range already present in the schema and implies n is the object count, but adds no worked parameter examples or notes about out-of-range handling, so it only partially compensates for the coverage gap.

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 a specific mathematical function (subfactorial !n), defines it as the number of derangements of n objects, and anchors it with worked values (!0=1, !1=0, !2=1, !5=44). An agent knows exactly what computation this performs and could distinguish it from alt_factorial or factorial-style siblings.

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?

Gives the usable domain (n from 0 to 4096) and notes an equivalent HTTPS endpoint, which helps an agent decide it can call this. However, it never states when to prefer this over sibling combinatorics tools, nor what happens on failure or invalid input.

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