Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm9_encryption

Read-only

[sm9_ibc] SM9 标识加密(GM/T 0044)。任何人持主公钥即可加密:输入 master_public_key_in_pem(key_kind=Enc 的主公钥)、identity(接收方标识,密文与标识绑定)、plain_data_in_hex(明文 hex,1-255 字节,SM9 单次加密上限受 KDF 块计数器约束)。输出:cipher_in_hex / cipher_in_base64(DER 编码密文,C1/C3/C2 结构,≤367 字节)。

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_encryption"
  }
}

Input Schema

NameRequiredDescriptionDefault
identityNoSM9 用户标识(原始字符串,如邮箱/账号,1-63 UTF-8 字节;签名/加密/解密均与该标识绑定)
plain_data_in_hexNo明文的十六进制字符串
master_public_key_in_pemNoSM9 主公钥的 PEM 文本(明文形态,验签/加密侧使用;Sign/Enc 两类主密钥的公钥标签不同)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds substantive behavior: the ciphertext is bound to the identity, plaintext is capped at 1-255 bytes by the SM9 KDF block counter, and output is DER C1/C3/C2 of at most 367 bytes. It does not mention error behavior when the size cap is exceeded, so it is not exhaustive.

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?

Front-loaded with the tag and the one-line purpose, then inputs, then outputs in a predictable order. The nested parentheticals are dense but each carries constraint information; only minor tightening is possible.

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 compensates by specifying the return field names, encoding and structure, and it covers all three parameters plus size limits. What is missing is minor: whether any identity string is acceptable without prior registration, and failure behavior.

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 already 100%, but the description still adds meaning: master_public_key_in_pem must be the Enc-class master public key (key_kind=Enc), and plaintext must be 1-255 bytes in hex, a constraint absent from the schema. Identity binding to the ciphertext is also clarified beyond the schema text.

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?

States a specific verb and resource: SM9 identity-based encryption per GM/T 0044, tagged [sm9_ibc]. It is immediately distinguishable from sm9_decryption, sm2_encryption and rsa_encryption by the IBE master-public-key model it describes.

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?

"Anyone holding the master public key can encrypt" gives the key prerequisite that selects this tool over the decryption sibling (which needs a user private key). It does not explicitly name alternatives or state when not to use it, so it stops short of full routing guidance.

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.