Skip to main content
Glama

ScorpTech x402 Tools

Ternary Digit

ternary_digit
Read-onlyIdempotent

The balanced ternary digit of n in place, counting from 0 at the right, as -1, 0, or 1. For 5, which is "1TT", place 0 and place 1 are -1 and place 2 is 1. A place past the end is 0. n runs from 0 to 999999999999999 and place runs from 0 to 40. Returns JSON with: n, place, 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-digit

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>",
      "place": "<place>"
    },
    "name": "ternary_digit"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYes
placeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, so the safety bar is low, and the description still adds real behavior: deterministic out-of-range handling (past-the-end place = 0), the exact return object shape, and the paid x402 cost model per successful call with an HTTPS alternative. It doesn't state error behavior for out-of-range n, which keeps it from 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 core definition, then the example, then edge case, then return/price/endpoint — a sensible order with no filler sentences. The bounds sentence partially duplicates the schema, and the price/URL tail is dense but each piece is load-bearing for an x402 caller.

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 supplies the return keys (n, place, value) and their value domain, plus bounds, edge-case semantics, and payment/auth expectations. Nothing an agent needs to call this correctly or interpret the result appears to be 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 coverage is 0%, so the description must carry parameter meaning and it largely does: 'place' is defined as counting from 0 at the right with a concrete example, and 'n' is implied as the number being decomposed, with both ranges restated. The role of n as the source value is inferred rather than stated outright, leaving a small 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?

Names a specific operation (extract one balanced-ternary digit) plus the indexing convention and return domain (-1, 0, 1). The worked example (5 = "1TT", place 0/1 = -1, place 2 = 1) distinguishes it from value-level siblings like ternary_value or balanced_ternary without needing their schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operative context: valid n and place ranges, and the edge-case rule that a place past the end yields 0, which tells an agent exactly when the tool applies and what it returns at boundaries. It does not explicitly exclude or route to sibling tools (e.g., when to use ternary_value instead), so it stops short of a 5.

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