Skip to main content
Glama

ScorpTech x402 Tools

Ternary Nonzero

ternary_nonzero
Read-onlyIdempotent

How many nonzero balanced ternary digits n uses. 0 has none, 3 has 1, 6 has 2, and 5 has 3. n runs from 0 to 999999999999999. 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/ternary-nonzero

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

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 cover the safety profile (readOnly, idempotent, non-destructive, openWorld), so the description's job is to add context — and it does: it discloses pricing ($0.001 USDC per successful call via x402 on Base or Solana) and an alternate HTTPS endpoint. That payment/transport detail is materially useful and appears nowhere in the structured fields.

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 core definition, followed by compact examples, then return shape, price, and endpoint. Every clause carries information; nothing is redundant filler.

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 single-parameter pure-function tool with no output schema, the description supplies the operation, domain bounds, examples, return field names, cost, and an alternate endpoint. The only gap is that 'value' is not explicitly equated with the digit count, which would fully close the loop.

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 must carry parameter meaning, and it does: it defines n's valid range and illustrates the mapping with four concrete input/output examples. The only shortfall is that the returned field named 'value' is never explicitly defined as the count.

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 a specific verb+resource: counting the nonzero balanced ternary digits used by n. The worked examples (0→0, 3→1, 6→2, 5→3) make the operation unambiguous and separate it from neighbors like ternary_len or ternary_digit, though it never names those siblings directly.

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 implied by the domain constraint ('n runs from 0 to 999999999999999') and the examples, so an agent can tell this counts nonzero digits rather than total length. However, there is no explicit when-to-use / when-not guidance and no comparison to the related ternary tools, leaving selection to inference.

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