Skip to main content
Glama

CipherHUB Cryptography Toolkit

data_padding

Read-only

[symmetric_cipher] PKCS7 填充/去填充工具。 【参数】

  • padding_action:DoPadding(填充到 16 字节对齐)或 UnPadding(去填充)

  • data_in_hex:待处理数据 Hex 【输出】output_data_in_hex、output_length。 【说明】块大小固定 16 字节(AES/SM4 块大小)。通常无需单独调用此工具,block_cipher 内部已自动处理填充。

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": {
      "data_in_hex": "<data_in_hex>"
    },
    "name": "data_padding"
  }
}

Input Schema

NameRequiredDescriptionDefault
data_in_hexYes数据的十六进制字符串。RAW 模式为消息原文 Hex,DIGEST 模式为哈希摘要 Hex
padding_actionNo填充操作,可选值:DoPadding(填充到 16 字节对齐)/ UnPadding(去填充)DoPadding

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / data_in_hex / description
      Added value: +"数据的十六进制字符串。RAW 模式为消息原文 Hex,DIGEST 模式为哈希摘要 Hex"
    • addedInput schema / properties / padding_action / description
      Added value: +"填充操作,可选值:DoPadding(填充到 16 字节对齐)/ UnPadding(去填充)"
    • addedInput schema / properties / padding_action / enum
      Added value: +[
      +  "DoPadding",
      +  "UnPadding"
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description is consistent with a pure computation. Beyond that it discloses the fixed 16-byte block size (AES/SM4) and the exact return fields (output_data_in_hex, output_length), which the annotations do not cover. It does not mention error behavior for malformed hex or invalid padding, which is the main remaining gap.

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 labeled sections (parameters, output, notes) make it easy to scan, and the most important routing note is placed last but is short. A few lines duplicate the schema verbatim, which is mild waste but not harmful.

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?

For a two-parameter pure-function tool with no output schema, the description covers inputs, the fixed block size, and the return fields, which is enough to call it correctly. Only edge-case behavior (invalid hex, unpadding data that is not padded) is left unstated.

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 coverage is 100%, so both parameters are already documented, including the enum values and the 16-byte alignment meaning. The description restates the same information and adds only the rationale that 16 bytes is the AES/SM4 block size, so it is a baseline 3 rather than a value-add.

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 names a specific verb and resource (PKCS7 padding/unpadding) and scopes it with the concrete algorithm and block size. It also distinguishes itself from the sibling block_cipher by noting that block_cipher already performs padding internally, so an agent can tell the two apart without opening either schema.

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?

It gives an explicit when-not-to-use rule ("usually no need to call this tool separately; block_cipher handles padding internally"), which is the most important routing decision for this tool. It stops short of stating the positive case, e.g. when standalone padding is needed for custom formats, but the exclusion is clear and actionable.

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.