Skip to main content
Glama
laszlopere

mcp-bytesmith

byte_order

Convert values between host and network byte order, handling little/big endian with optional fixed-width field grouping.

Instructions

Convert a value between host and network byte order (htons/htonl/ntohs/ntohl).

data is decoded via input_format (hex default). from_order/to_order are little|big|network|host: network is big-endian, host resolves to the platform's sys.byteorder — so on a little-endian box from_order=host to_order=network is htonl/htons. width (bytes) sets a fixed field size: a shorter buffer is left zero-padded up to width, a longer one is split into width-byte groups each swapped independently (array semantics); omit it to swap the whole buffer as one field. Differing orders reverse each field; equal orders only apply the width normalization. Returns {result, from_order, to_order, width, output_format}; result is rendered via output_format. Example: byte_order("0x12345678", "little", "big") -> result "78563412"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesHex byte buffer (0x-prefix optional) to byte-swap, treated as a sequence of fixed-size `width`-byte fields.
from_orderYesCurrent byte order of `data`: little|big|network|host (network=big-endian, host=platform's sys.byteorder).
to_orderYesTarget byte order: little|big|network|host. Differing orders reverse each field; equal orders only apply width normalization.
widthNoFixed field size in bytes: a shorter buffer is left zero-padded up to it, a longer one is split into width-byte groups each swapped independently. Default None swaps the whole buffer as one field.
input_formatNoHow `data` is decoded to bytes; default 'hex'.hex
output_formatNoHow `result` is rendered; default 'hex'.hex
Behavior5/5

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

With no annotations, the description fully discloses behavior: it covers byte swapping logic, width-based grouping and padding, handling of equal orders, and return format. There are no contradictions or omissions.

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?

The description is concise (single paragraph) and front-loaded with the core purpose. It could be slightly more structured (e.g., bullet points), but every sentence adds value and there is no redundancy.

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?

Given the tool's complexity (6 parameters, byte order conversion), the description is remarkably complete. It explains all parameters, edge cases (different widths, equal orders), and the return format, leaving no gaps.

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?

Despite 100% schema coverage, the description adds significant value beyond the schema: it explains 'host' resolves to sys.byteorder, clarifies width's array semantics, and provides a concrete example, greatly aiding parameter understanding.

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 clearly states the verb 'Convert a value between host and network byte order' and specifies the resource. It also mentions analogous functions (htons/htonl/ntohs/ntohl) and provides an example, making the purpose highly specific and distinguishable from siblings like decode or hash.

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?

The description explains when to use the tool (byte order conversion) and thoroughly details each parameter's role. However, it does not explicitly state when not to use it or directly compare with alternatives, though siblings are distinct enough.

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/laszlopere/mcp-bytesmith'

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