Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm9_decryption

Read-only

[sm9_ibc] SM9 标识解密(GM/T 0044)。接收方用 KGC 派发的用户钥解密:输入 user_private_key_in_pem(SM9ExtractKey key_kind=Enc 输出)、private_key_password(用户钥口令,与提取时一致)、identity(接收方标识,必须与加密时一致)、cipher_data_in_hex(DER 密文,≤367 字节)。输出:plain_data_in_hex、plain_length。口令错或标识不符返回 'SM9 decrypt failed'。

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

Input Schema

NameRequiredDescriptionDefault
identityNoSM9 用户标识(原始字符串,如邮箱/账号,1-63 UTF-8 字节;签名/加密/解密均与该标识绑定)
cipher_data_in_hexNo密文的十六进制字符串
private_key_passwordNo私钥的加密密码(原始字符串,非编码格式),可选
user_private_key_in_pemNoSM9 加密用户私钥的 PEM 文本(含 BEGIN ENCRYPTED SM9 ... PRIVATE KEY 头尾,由 SM9ExtractKey 派发)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), and the description adds real behavioral detail on top: the ciphertext size limit (≤367 bytes), the exact failure string 'SM9 decrypt failed' for a wrong password or mismatched identity, and the shape of the returned values. It stops short of saying how the plaintext is encoded beyond hex or whether output length is in bytes, but the gaps are minor.

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?

It is front-loaded with purpose, then inputs, then outputs, then failure behavior, and every clause carries information. The heavy parenthetical nesting makes it dense to read, but nothing is padding.

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?

There is no output schema, and the description compensates by naming the return fields (plain_data_in_hex, plain_length) and the error case. Combined with the key-provenance and input-consistency requirements, an agent has everything needed to invoke this correctly.

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 would be 3. The description earns above that by tying parameters to each other and to other tools: the PEM's provenance (SM9ExtractKey key_kind=Enc), the password's consistency requirement with extraction, and the identity's consistency requirement with encryption. It also adds the ciphertext size constraint, which the schema does not state.

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 gives a specific verb and resource (SM9 identity-based decryption, GM/T 0044) and immediately scopes it to the receiver side using a KGC-issued user key. That distinguishes it cleanly from siblings such as sm9_encryption and sm9_extract_key without needing to open 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 states the preconditions that select this tool: the PEM must be the output of SM9ExtractKey with key_kind=Enc, the password must match the one used at extraction, and the identity must match the one used at encryption. It doesn't explicitly route to a sibling for the inverse operation (sm9_encryption), but the context is unambiguous.

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.