Skip to main content
Glama

base_repr

Convert a number to another base representation, supporting custom width, two's complement, and signed-overflow detection.

Instructions

hex/oct/bin of N; with WIDTH, two's complement and signed-overflow detection. base_repr(3000000000, 32) says plainly it does not fit i32.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes
widthNo
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses key behaviors: two's complement handling, signed-overflow detection, and an example that shows how overflow is reported. However, it omits details on return format, error behavior, or edge cases like negative numbers without width.

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?

The description is two sentences: the first concisely states the purpose and key modifiers (width, two's complement, overflow), and the second provides a concrete example. Every word earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and only two parameters, the description captures the essential behavior but leaves gaps: it does not specify the return type (e.g., a string representation) or how errors are signaled beyond the example. For a tool with overflow detection, more detail on output structure would be helpful.

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%, but the description adds meaning beyond the schema: it explains that width enables two's complement and overflow detection, and the example clarifies the parameters' interaction. It does not fully define the output format for each base, but it compensates adequately for the lack of schema detail.

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?

The description states the core function—converting N to hex, octal, or binary—with explicit mention of width-based two's complement and overflow detection. It clearly distinguishes from siblings like float_repr and radix_convert by highlighting the overflow-checking capability.

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?

The description implies usage when width or overflow detection is needed, but it does not explicitly state when not to use this tool or name alternative tools. The example hints at a specific scenario but lacks direct guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/The-40-Thieves/codecalc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server