Skip to main content
Glama
ethan-hub26

embedcalc-mcp

by ethan-hub26

CRC → C Code Generator

embedcalc_crc_to_c
Read-onlyIdempotent

Generate a compilable C CRC-8/16/32 implementation with 256-entry lookup table and built-in check value. Supports common presets or custom Rocksoft parameters.

Instructions

Generate a complete, compilable C implementation (256-entry lookup table + compute function) for any CRC-8/16/32, plus its standard check value.

Use a preset for common CRCs, or specify the Rocksoft model parameters (width/poly/init/reflect-in/reflect-out/xor-out) for a custom CRC. The generated code embeds check("123456789") so the result can be verified on target.

Args:

  • preset (optional): one of CRC-8, CRC-8/MAXIM, CRC-16/CCITT, CRC-16/ARC, CRC-16/MODBUS, CRC-32, CRC-32/BZIP2. Overrides all other args.

  • bits (8|16|32), poly_hex (e.g. '0x1021'): required for a custom CRC.

  • init_hex, reflect_in, reflect_out, xor_out_hex: optional custom parameters (defaults: 0x0, false, false, 0x0).

Returns (structured): { check_hex, config, c_code }. The text content is the C source itself.

Examples:

  • "MODBUS RTU CRC in C" -> preset='CRC-16/MODBUS'

  • "CRC-16 poly 0x1021 init 0xFFFF, no reflection" -> bits=16, poly_hex='0x1021', init_hex='0xFFFF' Check values are exact (e.g. CRC-16/CCITT -> 0x29B1, CRC-32 -> 0xCBF43926); do not estimate CRCs — call this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bitsNoCRC width in bits (8, 16, or 32). Required when no preset is given.
presetNoStandard CRC preset. If given, all other parameters are ignored. One of: CRC-8, CRC-8/MAXIM, CRC-16/CCITT, CRC-16/ARC, CRC-16/MODBUS, CRC-32, CRC-32/BZIP2
init_hexNoInitial CRC register value in hex (default 0x0).
poly_hexNoGenerator polynomial in normal (non-reflected) hex form, e.g. '0x1021'. Required when no preset is given.
reflect_inNoReflect each input byte (LSB-first processing). Default false.
reflect_outNoReflect the final CRC before XOR-out. Default false.
xor_out_hexNoFinal XOR value in hex (default 0x0).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
c_codeYesComplete, compilable C source: 256-entry lookup table + crcN_compute() function
configYes
check_hexYesCRC of the ASCII string "123456789" — the standard check value for verifying the parameters
Behavior5/5

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

Discloses that the generated code embeds a check value for verification, and that it returns a structured object with check_hex, config, and c_code. Annotations (readOnlyHint, idempotentHint, destructiveHint) are consistent and not contradicted.

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?

Well-structured with clear sections: main purpose, usage, args, returns, examples. Every sentence adds value; no fluff.

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 (7 params, custom vs preset logic) and that an output schema exists, the description covers all necessary details: behavior, parameters, return format, and examples.

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?

While schema already covers 100% of parameters, the description adds meaningful context: explains the Rocksoft model, shows examples like poly_hex '0x1021', and clarifies that preset overrides all other args.

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 it generates a complete C implementation for CRC-8/16/32, including the standard check value. It uses specific verbs and resources, and distinguishes from other sibling embedcalc tools.

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

Usage Guidelines5/5

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

Explicitly tells when to use a preset vs custom parameters, provides examples like 'MODBUS RTU CRC in C' mapping to 'CRC-16/MODBUS', and warns not to estimate CRCs but to call this tool.

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/ethan-hub26/embedcalc-mcp'

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