Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm9_sign

Read-only

[sm9_ibc] SM9 标识签名(GM/T 0044)。签名者用 KGC 派发的用户钥签名:输入 user_private_key_in_pem(SM9ExtractKey key_kind=Sign 输出)、private_key_password(用户钥口令)、data_in_hex(消息原文 hex,签名前内部先算 SM3 摘要,流式处理,仅支持原文模式)。输出:signature_in_hex / signature_in_base64(DER 编码签名,固定 104 字节)。

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

Input Schema

NameRequiredDescriptionDefault
data_in_hexNo数据的十六进制字符串。RAW 模式为消息原文 Hex,DIGEST 模式为哈希摘要 Hex
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.3/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. The description adds meaningful behavior beyond them: an SM3 digest is computed internally before signing, processing is streaming, only RAW (plaintext) mode is supported, and the DER signature is a fixed 104 bytes. It does not state what happens with a wrong password or missing key, which keeps it from a 5.

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 description is one dense but well-ordered block: it gives purpose, then inputs and provenance, then output. Every clause carries information, and nothing is repeated from the schema verbatim. It is slightly wordy with parentheticals, but the structure is clear.

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?

The description covers the prerequisite key source, the digest behavior, the mode constraint, and the exact output fields, which is sufficient for a 3-parameter tool without an output schema. Only error and failure behavior remain undocumented.

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, but the description adds real meaning: it identifies where user_private_key_in_pem comes from, confirms private_key_password is the user-key passphrase, and resolves a schema ambiguity. The schema says data_in_hex can be RAW or DIGEST mode, but the description says only RAW plaintext is supported and SM3 is computed internally.

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 operation (SM9 identity-based signing, GM/T 0044) and its scope: it signs a message with a KGC-issued user key. It distinguishes this tool from sibling tools such as sm9_verify and sm9_extract_key by tying the signing key to a specific source, so an agent can select this tool without opening the 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 clear context for when to use the tool and states the prerequisite: user_private_key_in_pem must be produced by SM9ExtractKey with key_kind=Sign. It does not explicitly route the agent to sm9_verify for the opposite operation or to sm2_sign and ecc_key_sign for other curves, but the prerequisite workflow is concrete.

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.