Skip to main content
Glama

ScorpTech x402 Tools

Alternating Factorial

alternating_factorial
Read-onlyIdempotent

The alternating factorial a(n) = n! - a(n-1), with a(1) = 1. a(3) is 5, a(4) is 19, a(5) is 101, a(6) is 619, and a(8) is 35899. n runs from 1 to 18. 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/alternating-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": "alternating_factorial"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and openWorld, so the safety profile is covered. The description adds genuinely useful context beyond that: the JSON return shape (n, value), a per-call price of $0.001 USDC via x402 on Base or Solana, and an equivalent HTTPS endpoint — pricing is exactly the kind of operational detail annotations cannot convey.

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?

Front-loaded with the formula and base case, then examples, then range, then output shape, then cost/endpoint — a sensible information hierarchy with no filler. The extra example values are compact and serve verification rather than padding.

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?

For a single-parameter pure math function with no output schema, the description supplies the definition, the domain bound already mirrored in the schema, the return keys, and the payment/transport details. Nothing an agent needs to call it correctly is missing.

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 description coverage is 0%, so the description carries the burden — and it does: it defines n's meaning through the formula, states the valid domain (1 to 18), and anchors it with concrete example values that let an agent sanity-check a call. Minor gap: it does not say what happens at the boundary or what a(n) denotes in the output field name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives the exact recurrence a(n) = n! - a(n-1) with base case a(1) = 1, plus worked values (a(3)=5, a(8)=35899), so the computed resource is unambiguous and clearly distinct from plain factorial or double_factorial. It stops short of naming or contrasting the near-identical sibling alt_factorial, so an agent must still infer that relationship.

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: the domain constraint 'n runs from 1 to 18' plus the worked examples tell the agent this evaluates one term at a given index. There is no explicit statement of when to choose this over alt_factorial or alternating_next, and no guidance on out-of-range input handling.

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