Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm2_decryption

Read-only

[sm2] SM2 私钥解密。 【参数】

  • sm2_private_key_in_pem:PEM 格式私钥

  • cipher_data_in_hex:密文 Hex

  • cipher_format:必须指定 C1C3C2_ASN1 / C1C2C3_ASN1 / C1C3C2 / C1C2C3

  • sm2_private_key_password:若私钥加密则传入 【输出】plain_data_in_hex、plain_length。 【注意】cipher_format 必须与加密时的格式对应,否则解密失败。

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": "sm2_decryption"
  }
}

Input Schema

NameRequiredDescriptionDefault
cipher_formatNoSM2 密文编码格式,可选值:C1C3C2_ASN1 / C1C2C3_ASN1 / C1C3C2 / C1C2C3
cipher_data_in_hexNo密文的十六进制字符串
sm2_private_key_in_pemNoSM2 加密私钥的 PEM 文本(含 BEGIN/END ENCRYPTED PRIVATE KEY 头尾)
sm2_private_key_passwordNoSM2 私钥的加密密码(原始字符串,非编码格式)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / cipher_data_in_hex / description
      Added value: +"密文的十六进制字符串"
    • addedInput schema / properties / cipher_format / description
      Added value: +"SM2 密文编码格式,可选值:C1C3C2_ASN1 / C1C2C3_ASN1 / C1C3C2 / C1C2C3"
    • addedInput schema / properties / cipher_format / enum
      Added value: +[
      +  "C1C3C2_ASN1",
      +  "C1C2C3_ASN1",
      +  "C1C3C2",
      +  "C1C2C3"
      +]
    • addedInput schema / properties / sm2_private_key_in_pem / description
      Added value: +"SM2 加密私钥的 PEM 文本(含 BEGIN/END ENCRYPTED PRIVATE KEY 头尾)"
    • addedInput schema / properties / sm2_private_key_password / description
      Added value: +"SM2 私钥的加密密码(原始字符串,非编码格式)"
  2. First observed

TDQS

A3.8/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, so the safety profile is covered. The description adds genuine behavioral value the annotations lack: the hard failure mode where a mismatched cipher_format makes decryption fail, and the conditional requirement of the private-key password. It does not cover error surfaces beyond that, but the key operational gotcha is disclosed.

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 sectioned 【参数】/【输出】/【注意】 layout is easy to scan and the failure caveat is placed where it will be read. It loses a point because the parameter block largely restates schema descriptions that already have full coverage.

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 correctly supplies the return fields (plain_data_in_hex, plain_length), and it documents all four parameters plus the format-matching pitfall. For a four-parameter crypto primitive this is nearly complete; only explicit sibling routing is absent.

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 100%, so the baseline is 3. The description still adds meaning: it flags that sm2_private_key_password is only needed when the PEM key is encrypted, and it frames cipher_format as something that must match the encryption-time encoding, which the schema does not say.

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 description states a specific verb and resource ('SM2 私钥解密'), and the [sm2] tag plus the 'private key decryption' wording separates it from sm2_encryption, rsa_decryption and sm9_decryption. It is clear what the tool does, though it never explicitly contrasts itself with 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?

Usage is only implied: an agent infers it is for decrypting ciphertext produced by SM2 encryption. There is no explicit 'use this when… / use X instead' guidance and no stated prerequisites beyond the passing remark that the key password is supplied when the key is encrypted.

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.