Skip to main content
Glama

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. Price: $0.001 USDC per successful call (x402, 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

B3.2/5.0
Behavior3/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 operational context that annotations cannot: it is a paid x402 call at $0.001 USDC per successful call, and the same tool is reachable over HTTPS POST at a stated URL. It stops short of explaining return format or failure behavior, but with annotations present this is reasonable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The definition and recurrence are front-loaded, which is right. The run of sample values (a(3), a(4), a(5), a(6), a(8) - notably skipping a(7)) consumes most of the text for little selection value compared with the formula, which already pins the sequence down.

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 one-integer-in math primitive with no output schema, the definition, closure condition, domain and cost/transport details are enough to call it correctly. Only the return type (the integer a(n)) is left implicit, which is a minor gap for this tool class.

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 carries the burden for the single parameter n. It does define n as the index into a(n) and restates the 1-18 range already encoded as minimum/maximum in the schema, which adds only marginal meaning beyond the structured field.

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 recurrence a(n) = n! - a(n-1) with a(1)=1 plus worked values specifies exactly which sequence is computed, which is clear verb-free but mathematically precise. However, the sibling list contains alt_factorial and several alternating_* tools, and nothing in the description distinguishes this tool from them.

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?

There is no statement of when to pick this tool over alt_factorial, alternating_mod, alternating_sum or alternating_next, all of which are plausible near-neighbors. The only constraint given is the domain of n (1-18), which is a parameter bound rather than usage guidance.

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