Skip to main content
Glama

CipherHUB Cryptography Toolkit

block_cipher

Read-only

[symmetric_cipher] 分组密码 CBC 模式加解密。 【算法】AES128(key=16B) / AES256(key=32B) / SM4(key=16B)。 【参数】

  • algorithm:算法名

  • process_type:Encrypt 或 Decrypt

  • input_data_in_hex:明文或密文 Hex(1B~16MB)

  • key_in_hex:密钥 Hex

  • iv_in_hex:初始向量 Hex(固定 16 字节 = 32 hex 字符) 【自动行为】加密自动 PKCS7 填充,解密自动去填充。 【输出】output_data_in_hex、output_length、output_sha256、algorithm。 【注意】解密时密文长度必须为 16 字节整数倍。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "block_cipher"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)AES256
iv_in_hexNo初始向量的十六进制字符串,固定 32 个 hex 字符(16 字节)
key_in_hexNo密钥的十六进制字符串。长度取决于算法:AES256=64 字符(32B),AES128/SM4=32 字符(16B)
process_typeNo操作类型,可选值:Encrypt / DecryptEncrypt
input_data_in_hexNo输入数据的十六进制字符串(加密时为明文,解密时为密文,1B~16MB)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / algorithm / description
      Added value: +"密码算法名称(具体可选值因工具而异,见工具描述)"
    • addedInput schema / properties / algorithm / enum
      Added value: +[
      +  "AES128",
      +  "AES256",
      +  "SM4"
      +]
    • addedInput schema / properties / input_data_in_hex / description
      Added value: +"输入数据的十六进制字符串(加密时为明文,解密时为密文,1B~16MB)"
    • addedInput schema / properties / iv_in_hex / description
      Added value: +"初始向量的十六进制字符串,固定 32 个 hex 字符(16 字节)"
    • addedInput schema / properties / key_in_hex / description
      Added value: +"密钥的十六进制字符串。长度取决于算法:AES256=64 字符(32B),AES128/SM4=32 字符(16B)"
    • addedInput schema / properties / process_type / description
      Added value: +"操作类型,可选值:Encrypt / Decrypt"
    • addedInput schema / properties / process_type / enum
      Added value: +[
      +  "Encrypt",
      +  "Decrypt"
      +]
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations, the description discloses that encryption applies PKCS7 padding automatically and decryption strips it, states the ciphertext length multiple-of-16 requirement, and lists the returned fields. These are real behavioral traits not present in the schema. Annotations (readOnlyHint=true, openWorldHint=false) are consistent with a stateless computation, so no contradiction.

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 bracket-headed sections (algorithm/parameters/auto behavior/output/notes) are front-loaded and scannable, with no filler sentences. There is mild duplication of the schema's key-length and IV rules, but each line still serves a purpose.

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

Completeness4/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 usefully enumerates the return fields (output_data_in_hex, output_length, output_sha256, algorithm) and states the input-size and length-alignment constraints. For a 5-parameter cryptographic tool this is close to complete, missing only explicit sibling selection guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents every parameter including enum values and key-length rules. The description's parameter block largely restates that (algorithm, key size, IV 32 hex chars, 1B~16MB range) rather than adding new meaning, so the baseline 3 applies.

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?

The first line states a specific verb and mode: '分组密码 CBC 模式加解密' (block cipher CBC mode encrypt/decrypt) and names the supported algorithms (AES128/AES256/SM4). CBC naming does distinguish it from ctr_cipher/stream_cipher/xts_cipher, though the description stops short of explicitly routing to those siblings.

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 '注意' and '参数' sections give operative constraints (key sizes per algorithm, IV fixed at 16 bytes, ciphertext length must be a multiple of 16 bytes on decrypt), which implies when the tool works. However, there is no explicit when-to-use/when-not guidance versus the sibling cipher tools, so an agent must infer the selection from the mode name alone.

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.