Skip to main content
Glama

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

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

Annotations already declare readOnly, idempotent, non-destructive, so the safety profile is covered. The description adds genuinely non-redundant context: a per-call price of $0.001 USDC via x402 on Solana, and a parallel HTTPS endpoint — critical for an agent deciding whether to call. It stops short of stating error behavior for out-of-range n or rate limits.

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 semantics and a compact example, then ranges, then pricing/endpoint metadata. Slightly over-specified where it repeats schema limits, but every sentence contributes.

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?

No output schema exists, and the description fully specifies return values (-1, 0, 1) plus the out-of-range-returns-0 rule, so the agent knows exactly what comes back. For a simple two-parameter read tool, nothing needed 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.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage the description must carry the load, and it does: place is defined as counting from 0 at the right, both value ranges are restated, and the edge case (a place past the end yields 0) is spelled out. The worked example resolves any remaining ambiguity about place indexing.

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?

States a concrete verb+resource: extracting the balanced ternary digit of n at a given place, returning -1/0/1, and clarifies with a worked example (5 = "1TT"). It is clearly distinguishable in practice from siblings like balanced_ternary or ternary_len, though it never names or contrasts them explicitly.

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 through the example and the out-of-range rule, so an agent can infer correct invocation. However, there is no explicit when-to-use/when-not guidance and no mention of when balanced_ternary, ternary_value, or ternary_len would be the better choice despite dozens of closely related siblings.

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